summaryrefslogtreecommitdiffstats
path: root/mp_msg.h
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-01-31 08:32:06 +0100
committerUoti Urpala <uau@mplayer2.org>2012-03-01 00:22:29 +0200
commit25417a626d0b9077bfbb940952f3858d7b8b549b (patch)
treee2f61063948b29a9e9fdb5c00fad8a571a367504 /mp_msg.h
parenteebe9309ecd70f86f0a52f09712db833df589206 (diff)
downloadmpv-25417a626d0b9077bfbb940952f3858d7b8b549b.tar.bz2
mpv-25417a626d0b9077bfbb940952f3858d7b8b549b.tar.xz
windows: fix format string attributes on MinGW
MinGW maps the "printf" format string archetype to the non-standard MSVCRT functions, even if __USE_MINGW_ANSI_STDIO is defined and set to 1. We need to use "gnu_printf" to use the format strings as provided by vsnprintf and similar functions to get correct warnings. Since "gnu_printf" isn't necessarily available on other GCC compatible compilers (such as clang), do this only on MinGW.
Diffstat (limited to 'mp_msg.h')
-rw-r--r--mp_msg.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/mp_msg.h b/mp_msg.h
index 6e800aecf2..686ed8316c 100644
--- a/mp_msg.h
+++ b/mp_msg.h
@@ -130,19 +130,15 @@ void mp_msg_init(void);
int mp_msg_test(int mod, int lev);
#include "config.h"
+#include "mpcommon.h"
char *mp_gtext(const char *string);
void mp_msg_va(int mod, int lev, const char *format, va_list va);
-#ifdef __GNUC__
-void mp_msg(int mod, int lev, const char *format, ... ) __attribute__ ((format (printf, 3, 4)));
-void mp_tmsg(int mod, int lev, const char *format, ... ) __attribute__ ((format (printf, 3, 4)));
-static inline void mp_dbg(int mod, int lev, const char *format, ...) __attribute__ ((format (printf, 3, 4)));
-#else // not GNU C
-void mp_msg(int mod, int lev, const char *format, ... );
-void mp_tmsg(int mod, int lev, const char *format, ...)
-#endif /* __GNUC__ */
+void mp_msg(int mod, int lev, const char *format, ... ) PRINTF_ATTRIBUTE(3, 4);
+void mp_tmsg(int mod, int lev, const char *format, ... ) PRINTF_ATTRIBUTE(3, 4);
+static inline void mp_dbg(int mod, int lev, const char *format, ...) PRINTF_ATTRIBUTE(3, 4);
static inline void mp_dbg(int mod, int lev, const char *format, ...)
{