[commit: ghc] master: Fix build on OS X (9aa3a7b)
Ian Lynagh
igloo at earth.li
Fri Apr 27 16:23:27 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/9aa3a7b650e1147220dec7366c3696edd471ff8c
>---------------------------------------------------------------
commit 9aa3a7b650e1147220dec7366c3696edd471ff8c
Author: Ian Lynagh <igloo at earth.li>
Date: Fri Apr 27 11:48:37 2012 +0100
Fix build on OS X
>---------------------------------------------------------------
includes/stg/Types.h | 22 ++++++++++++++--------
rts/Disassembler.c | 4 ++--
2 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/includes/stg/Types.h b/includes/stg/Types.h
index 0c71ea4..839c064 100644
--- a/includes/stg/Types.h
+++ b/includes/stg/Types.h
@@ -57,13 +57,15 @@ typedef unsigned short StgWord16;
#if SIZEOF_INT == 4
typedef signed int StgInt32;
typedef unsigned int StgWord32;
-#define FMT_Word32 "u"
-#define FMT_Int32 "d"
+#define FMT_Word32 "u"
+#define FMT_HexWord32 "x"
+#define FMT_Int32 "d"
#elif SIZEOF_LONG == 4
typedef signed long StgInt32;
typedef unsigned long StgWord32;
-#define FMT_Word32 "lu"
-#define FMT_Int32 "ld"
+#define FMT_Word32 "lu"
+#define FMT_HexWord32 "lx"
+#define FMT_Int32 "ld"
#else
#error GHC untested on this architecture: sizeof(int) != 4
#endif
@@ -71,13 +73,15 @@ typedef unsigned long StgWord32;
#if SIZEOF_LONG == 8
typedef signed long StgInt64;
typedef unsigned long StgWord64;
-#define FMT_Word64 "lu"
-#define FMT_Int64 "ld"
+#define FMT_Word64 "lu"
+#define FMT_HexWord64 "lx"
+#define FMT_Int64 "ld"
#elif SIZEOF_LONG_LONG == 8
typedef signed long long int StgInt64;
typedef unsigned long long int StgWord64;
-#define FMT_Word64 "llu"
-#define FMT_Int64 "lld"
+#define FMT_Word64 "llu"
+#define FMT_HexWord64 "llx"
+#define FMT_Int64 "lld"
#else
#error cannot find a way to define StgInt64
#endif
@@ -99,6 +103,7 @@ typedef StgWord64 StgWord;
typedef StgInt32 StgHalfInt;
typedef StgWord32 StgHalfWord;
#define FMT_Word FMT_Word64
+#define FMT_HexWord FMT_HexWord64
#define FMT_Int FMT_Int64
#else
#if SIZEOF_VOID_P == 4
@@ -107,6 +112,7 @@ typedef StgWord32 StgWord;
typedef StgInt16 StgHalfInt;
typedef StgWord16 StgHalfWord;
#define FMT_Word FMT_Word32
+#define FMT_HexWord FMT_HexWord32
#define FMT_Int FMT_Int32
#else
#error GHC untested on this architecture: sizeof(void *) != 4 or 8
diff --git a/rts/Disassembler.c b/rts/Disassembler.c
index 4bb53c6..033af11 100644
--- a/rts/Disassembler.c
+++ b/rts/Disassembler.c
@@ -75,7 +75,7 @@ disInstr ( StgBCO *bco, int pc )
instrs[pc], (signed int)instrs[pc+1]);
pc += 2; break;
case bci_CCALL:
- debugBelch("CCALL marshaller at 0x%" FMT_HexSizeT "\n",
+ debugBelch("CCALL marshaller at 0x%" FMT_Word "\n",
literals[instrs[pc]] );
pc += 1; break;
case bci_STKCHECK: {
@@ -130,7 +130,7 @@ disInstr ( StgBCO *bco, int pc )
case bci_PUSH_UBX:
debugBelch("PUSH_UBX ");
for (i = 0; i < instrs[pc+1]; i++)
- debugBelch("0x%" FMT_HexSizeT " ", literals[i + instrs[pc]] );
+ debugBelch("0x%" FMT_Word " ", literals[i + instrs[pc]] );
debugBelch("\n");
pc += 2; break;
case bci_PUSH_APPLY_N:
More information about the Cvs-ghc
mailing list