diff options
author | wm4 <wm4@mplayer2.org> | 2012-01-31 08:32:06 +0100 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2012-03-01 00:22:29 +0200 |
commit | 25417a626d0b9077bfbb940952f3858d7b8b549b (patch) | |
tree | e2f61063948b29a9e9fdb5c00fad8a571a367504 /mp_msg.h | |
parent | eebe9309ecd70f86f0a52f09712db833df589206 (diff) | |
download | mpv-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.h | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -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, ...) { |