changeset 1568:2d4904c16667

modifications to use variable number of arguments in #define with GCC
author atlka
date Fri, 17 Aug 2001 07:26:07 +0000
parents 5c7760aa4f94
children fcbfc99cf8e6
files mp_msg.h
diffstat 1 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mp_msg.h	Fri Aug 17 00:40:25 2001 +0000
+++ b/mp_msg.h	Fri Aug 17 07:26:07 2001 +0000
@@ -47,11 +47,23 @@
 void mp_msg_init(int verbose);
 void mp_msg_c( int x, const char *format, ... );
 
-#define mp_msg(mod,lev,...) mp_msg_c((mod<<8)|lev,__VA_ARGS__)
+
+#ifdef __GNUC__
+#define mp_msg(mod,lev, args... ) mp_msg_c((mod<<8)|lev, ## args )
 
 #ifdef MP_DEBUG
-#define mp_dbg(mod,lev,...) mp_msg_c((mod<<8)|lev,__VA_ARGS__)
+#define mp_dbg(mod,lev, args... ) mp_msg_c((mod<<8)|lev, ## args )
 #else
 // these messages are only usefull for developers, disable them
-#define mp_dbg(mod,lev,...) 
+#define mp_dbg(mod,lev, args... ) 
 #endif
+#else // not GNU C
+#define mp_msg(mod,lev, ... ) mp_msg_c((mod<<8)|lev, __VA_ARGS__)
+
+#ifdef MP_DEBUG
+#define mp_dbg(mod,lev, ... ) mp_msg_c((mod<<8)|lev, __VA_ARGS__)
+#else
+// these messages are only usefull for developers, disable them
+#define mp_dbg(mod,lev, ... ) 
+#endif
+#endif