From 626180dd3f0d794c62da3ebb83270d309d66fc96 Mon Sep 17 00:00:00 2001 From: terminx Date: Thu, 15 Nov 2012 23:35:40 +0000 Subject: [PATCH] Make GCC *printf_nowarn behavior conditional on compiling as C++ git-svn-id: https://svn.eduke32.com/eduke32@3190 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/compat.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/polymer/eduke32/build/include/compat.h b/polymer/eduke32/build/include/compat.h index 32051d951..a5d0aaf07 100644 --- a/polymer/eduke32/build/include/compat.h +++ b/polymer/eduke32/build/include/compat.h @@ -677,8 +677,10 @@ char *Bstrupr(char *); var = print_func(fmt, ## __VA_ARGS__); \ } while (0) +#ifdef __cplusplus +#ifdef _MSC_VER // TODO: add MSVC pragmas to disable equivalent warning, if necessary later -#ifndef _MSC_VER +#else #ifdef _WIN32 // MinGW's _Pragma is completely broken so our GCC NOWARN macro is useless there #pragma GCC diagnostic ignored "-Wformat" @@ -693,8 +695,9 @@ char *Bstrupr(char *); #define NOWARN_RETURN(print_func, var, fmt, ...) do { _Pragma("GCC diagnostic ignored \"-Wformat\"") \ var = print_func(fmt, ## __VA_ARGS__); \ _Pragma("GCC diagnostic warning \"-Wformat\"") } while (0) -#endif -#endif +#endif // _WIN32 +#endif // _MSC_VER +#endif // __cplusplus #define OSD_Printf_nowarn(fmt, ...) NOWARN(OSD_Printf, fmt, ## __VA_ARGS__) #define Bsprintf_nowarn(fmt, ...) NOWARN(Bsprintf, fmt, ## __VA_ARGS__)