Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : master
http://hackage.haskell.org/trac/ghc/changeset/42760bd990661a199782c61f9d97123848c13b0e >--------------------------------------------------------------- commit 42760bd990661a199782c61f9d97123848c13b0e Author: Ian Lynagh <[email protected]> Date: Thu Apr 26 20:53:18 2012 +0100 OS X build fixes OS X doesn't understand 'gnu_printf', so we need to onyl use it conditionally. >--------------------------------------------------------------- includes/rts/Messages.h | 15 ++++++++++++--- rts/Stats.h | 11 ++++++++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/includes/rts/Messages.h b/includes/rts/Messages.h index e43155c..d3dabde 100644 --- a/includes/rts/Messages.h +++ b/includes/rts/Messages.h @@ -19,6 +19,15 @@ #include <stdarg.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 + /* ----------------------------------------------------------------------------- * Message generation * -------------------------------------------------------------------------- */ @@ -48,7 +57,7 @@ void vbarf(const char *s, va_list ap) * errorBelch() invokes (*errorMsgFn)(). */ void errorBelch(const char *s, ...) - GNUC3_ATTRIBUTE(format (gnu_printf, 1, 2)); + GNUC3_ATTRIBUTE(format (PRINTF, 1, 2)); void verrorBelch(const char *s, va_list ap); @@ -62,7 +71,7 @@ void verrorBelch(const char *s, va_list ap); * sysErrorBelch() invokes (*sysErrorMsgFn)(). */ void sysErrorBelch(const char *s, ...) - GNUC3_ATTRIBUTE(format (gnu_printf, 1, 2)); + GNUC3_ATTRIBUTE(format (PRINTF, 1, 2)); void vsysErrorBelch(const char *s, va_list ap); @@ -74,7 +83,7 @@ void vsysErrorBelch(const char *s, va_list ap); * debugBelch() invokes (*debugMsgFn)(). */ void debugBelch(const char *s, ...) - GNUC3_ATTRIBUTE(format (gnu_printf, 1, 2)); + GNUC3_ATTRIBUTE(format (PRINTF, 1, 2)); void vdebugBelch(const char *s, va_list ap); diff --git a/rts/Stats.h b/rts/Stats.h index f576e1f..d74cf29 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" _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
