Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : master
http://hackage.haskell.org/trac/ghc/changeset/5a3fdc0ce364a26362f6aee5ce6075eb10e8f811 >--------------------------------------------------------------- commit 5a3fdc0ce364a26362f6aee5ce6075eb10e8f811 Author: Ian Lynagh <[email protected]> Date: Fri Apr 27 01:27:48 2012 +0100 Fix build on Win32, and handle the FMT_* #defines in a slightly nicer way >--------------------------------------------------------------- includes/Rts.h | 13 ------------- includes/stg/Types.h | 23 ++++++++++++++++------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/includes/Rts.h b/includes/Rts.h index e060e14..501b9dc 100644 --- a/includes/Rts.h +++ b/includes/Rts.h @@ -145,19 +145,6 @@ void _assertFail(const char *filename, unsigned int linenum) #define FMT_SizeT "zu" #define FMT_HexSizeT "zx" -#define FMT_Word "zu" -#define FMT_Int "zd" - -/* - * Getting printf formats right for platform-dependent typedefs - */ -#if SIZEOF_LONG == 8 -#define FMT_Word64 "lu" -#define FMT_Int64 "ld" -#else -#define FMT_Word64 "llu" -#define FMT_Int64 "lld" -#endif /* ----------------------------------------------------------------------------- Time values in the RTS diff --git a/includes/stg/Types.h b/includes/stg/Types.h index e05690a..0c71ea4 100644 --- a/includes/stg/Types.h +++ b/includes/stg/Types.h @@ -54,12 +54,16 @@ typedef unsigned char StgWord8; typedef signed short StgInt16; typedef unsigned short StgWord16; -#if SIZEOF_LONG == 4 -typedef signed long StgInt32; -typedef unsigned long StgWord32; -#elif SIZEOF_INT == 4 +#if SIZEOF_INT == 4 typedef signed int StgInt32; typedef unsigned int StgWord32; +#define FMT_Word32 "u" +#define FMT_Int32 "d" +#elif SIZEOF_LONG == 4 +typedef signed long StgInt32; +typedef unsigned long StgWord32; +#define FMT_Word32 "lu" +#define FMT_Int32 "ld" #else #error GHC untested on this architecture: sizeof(int) != 4 #endif @@ -67,12 +71,13 @@ typedef unsigned int StgWord32; #if SIZEOF_LONG == 8 typedef signed long StgInt64; typedef unsigned long StgWord64; -#elif defined(__MSVC__) -typedef __int64 StgInt64; -typedef unsigned __int64 StgWord64; +#define FMT_Word64 "lu" +#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" #else #error cannot find a way to define StgInt64 #endif @@ -93,12 +98,16 @@ typedef StgInt64 StgInt; typedef StgWord64 StgWord; typedef StgInt32 StgHalfInt; typedef StgWord32 StgHalfWord; +#define FMT_Word FMT_Word64 +#define FMT_Int FMT_Int64 #else #if SIZEOF_VOID_P == 4 typedef StgInt32 StgInt; typedef StgWord32 StgWord; typedef StgInt16 StgHalfInt; typedef StgWord16 StgHalfWord; +#define FMT_Word FMT_Word32 +#define FMT_Int FMT_Int32 #else #error GHC untested on this architecture: sizeof(void *) != 4 or 8 #endif _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
