Commit 42760bd9 authored by Ian Lynagh's avatar Ian Lynagh

OS X build fixes

OS X doesn't understand 'gnu_printf', so we need to onyl use it
conditionally.
parent 0377f8f1
......@@ -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);
......
......@@ -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"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment