summaryrefslogtreecommitdiff
path: root/rts/Stats.h
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2012-04-26 20:53:18 +0100
committerIan Lynagh <igloo@earth.li>2012-04-26 21:04:18 +0100
commit42760bd990661a199782c61f9d97123848c13b0e (patch)
treea4dad5f4127c584f800526006fee4723612ad8b7 /rts/Stats.h
parent0377f8f187b4d636daeb7ec1d195a1aa334054ba (diff)
downloadhaskell-42760bd990661a199782c61f9d97123848c13b0e.tar.gz
OS X build fixes
OS X doesn't understand 'gnu_printf', so we need to onyl use it conditionally.
Diffstat (limited to 'rts/Stats.h')
-rw-r--r--rts/Stats.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/rts/Stats.h b/rts/Stats.h
index f576e1f91f..d74cf2972d 100644
--- a/rts/Stats.h
+++ b/rts/Stats.h
@@ -13,6 +13,15 @@
#include "BeginPrivate.h"
+#if defined(mingw32_HOST_OS)
+/* On Win64, if we say "printf" then gcc thinks we are going to use
+ MS format specifiers like %I64d rather than %llu */
+#define PRINTF gnu_printf
+#else
+/* However, on OS X, "gnu_printf" isn't recognised */
+#define PRINTF printf
+#endif
+
struct gc_thread_;
void stat_startInit(void);
@@ -64,7 +73,7 @@ Time stat_getElapsedTime(void);
/* Only exported for Papi.c */
void statsPrintf( char *s, ... )
- GNUC3_ATTRIBUTE(format (gnu_printf, 1, 2));
+ GNUC3_ATTRIBUTE(format (PRINTF, 1, 2));
#include "EndPrivate.h"