diff options
author | Uoti Urpala <uau@mplayer2.org> | 2011-06-29 09:51:49 +0300 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-06-29 09:51:49 +0300 |
commit | 9caae9b385a6de3f4dae98bebb1be64a997c1472 (patch) | |
tree | 40cc38748729fd2904a0ebe291bcca4d6915289a /mp_msg.h | |
parent | 4e1e23b2e92a756151d5c919057ad2fdad8996c2 (diff) | |
download | mpv-9caae9b385a6de3f4dae98bebb1be64a997c1472.tar.bz2 mpv-9caae9b385a6de3f4dae98bebb1be64a997c1472.tar.xz |
mp_msg: change mp_dbg() to inline function to check syntax
Change mp_dbg() from a macro that is defined to empty when MP_DEBUG is
unset to an inline function that has an empty body when MP_DEBUG is
unset. This allows the syntax of the calls to be checked even when
compiling without MP_DEBUG set.
Diffstat (limited to 'mp_msg.h')
-rw-r--r-- | mp_msg.h | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -140,16 +140,21 @@ 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__ */ +static inline void mp_dbg(int mod, int lev, const char *format, ...) +{ #ifdef MP_DEBUG -#define mp_dbg(mod,lev, ... ) mp_msg(mod, lev, __VA_ARGS__) -#else -#define mp_dbg(mod,lev, ... ) /* only useful for developers */ + va_list va; + va_start(va, format); + mp_msg_va(mod, lev, format, va); + va_end(va); #endif +} const char* filename_recode(const char* filename); |