summaryrefslogtreecommitdiff
path: root/includes/Rts.h
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2012-03-19 23:20:26 +0000
committerIan Lynagh <igloo@earth.li>2012-03-19 23:20:26 +0000
commit15e29424ca1da1ae469807793149dc2e928d9283 (patch)
tree76335f59b16b23e8d56c8363ee8186d796faba42 /includes/Rts.h
parentf424fc205bef02f5731243477b7d14c95b436b2e (diff)
downloadhaskell-15e29424ca1da1ae469807793149dc2e928d9283.tar.gz
Fix mkDerivedConstants on Win64
It was assuming that long's are word-sized, which is not the case on Win64.
Diffstat (limited to 'includes/Rts.h')
-rw-r--r--includes/Rts.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/includes/Rts.h b/includes/Rts.h
index cb23fd1083..c1f4f05bea 100644
--- a/includes/Rts.h
+++ b/includes/Rts.h
@@ -143,6 +143,24 @@ void _assertFail(const char *filename, unsigned int linenum)
#define USED_IF_NOT_THREADS
#endif
+#if SIZEOF_VOID_P == 8
+# if SIZEOF_LONG == 8
+# define FMT_SizeT "lu"
+# elif SIZEOF_LONG_LONG == 8
+# define FMT_SizeT "llu"
+# else
+# error Cannot find format specifier for size_t size type
+# endif
+#elif SIZEOF_VOID_P == 4
+# if SIZEOF_INT == 4
+# define FMT_SizeT "u"
+# else
+# error Cannot find format specifier for size_t size type
+# endif
+#else
+# error Cannot handle this word size
+#endif
+
/*
* Getting printf formats right for platform-dependent typedefs
*/