Mercurial > mplayer.hg
comparison mp_msg.h @ 10736:3e57b9c079b6
Handle mp_msg like printf so compiler can report if missing/too much arguments or other errors happen. GCC only
author | alex |
---|---|
date | Sun, 31 Aug 2003 19:15:33 +0000 |
parents | d172681d07eb |
children | b82e3ecb11e0 |
comparison
equal
deleted
inserted
replaced
10735:8a10d5d0ce86 | 10736:3e57b9c079b6 |
---|---|
105 #define mp_gettext(String) gettext(String) | 105 #define mp_gettext(String) gettext(String) |
106 #else | 106 #else |
107 #define mp_gettext(String) String | 107 #define mp_gettext(String) String |
108 #endif | 108 #endif |
109 | 109 |
110 void mp_msg_c( int x, const char *format, ... ); | |
111 | |
112 #ifdef __GNUC__ | 110 #ifdef __GNUC__ |
111 void mp_msg_c( int x, const char *format, ... ) __attribute__ ((format (printf, 2, 3))); | |
113 #define mp_msg(mod,lev, args... ) mp_msg_c(((mod)<<8)|(lev), ## args ) | 112 #define mp_msg(mod,lev, args... ) mp_msg_c(((mod)<<8)|(lev), ## args ) |
114 | 113 |
115 #ifdef MP_DEBUG | 114 #ifdef MP_DEBUG |
116 #define mp_dbg(mod,lev, args... ) mp_msg_c(((mod)<<8)|(lev), ## args ) | 115 #define mp_dbg(mod,lev, args... ) mp_msg_c(((mod)<<8)|(lev), ## args ) |
117 #else | 116 #else |
118 // these messages are only usefull for developers, disable them | 117 // these messages are only usefull for developers, disable them |
119 #define mp_dbg(mod,lev, args... ) | 118 #define mp_dbg(mod,lev, args... ) |
120 #endif | 119 #endif |
121 #else // not GNU C | 120 #else // not GNU C |
121 void mp_msg_c( int x, const char *format, ... ); | |
122 #define mp_msg(mod,lev, ... ) mp_msg_c(((mod)<<8)|(lev), __VA_ARGS__) | 122 #define mp_msg(mod,lev, ... ) mp_msg_c(((mod)<<8)|(lev), __VA_ARGS__) |
123 | 123 |
124 #ifdef MP_DEBUG | 124 #ifdef MP_DEBUG |
125 #define mp_dbg(mod,lev, ... ) mp_msg_c(((mod)<<8)|(lev), __VA_ARGS__) | 125 #define mp_dbg(mod,lev, ... ) mp_msg_c(((mod)<<8)|(lev), __VA_ARGS__) |
126 #else | 126 #else |