[MLton-commit] r5510

Matthew Fluet fluet at mlton.org
Wed Apr 11 13:38:39 PDT 2007


Use __WORDSIZE to print shorter pointers
----------------------------------------------------------------------

U   mlton/branches/on-20050822-x86_64-branch/runtime/util/pointer.h

----------------------------------------------------------------------

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/util/pointer.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/util/pointer.h	2007-04-11 20:37:45 UTC (rev 5509)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/util/pointer.h	2007-04-11 20:38:39 UTC (rev 5510)
@@ -12,6 +12,16 @@
 typedef pointerAux* pointer;
 
 #define POINTER_SIZE sizeof(pointer)
+#ifdef __WORDSIZE
+#if __WORDSIZE == 32
+#define FMTPTR "0x%08"PRIxPTR
+#elif __WORDSIZE == 64
 #define FMTPTR "0x%016"PRIxPTR
+#else
+#error __WORDSIZE unknown
+#endif
+#else
+#define FMTPTR "0x%08"PRIxPTR
+#endif
 
 typedef const unsigned char* code_pointer;




More information about the MLton-commit mailing list