Fixed debug build on mingw32, was broken due to recent changes in debug macros in print_message
authoretisserant
Mon, 18 Feb 2008 10:34:10 +0100
changeset 396 a43910975547
parent 395 1dad6ea260f2
child 397 f9e720b220ea
Fixed debug build on mingw32, was broken due to recent changes in debug macros in print_message
include/win32/applicfg.h
--- a/include/win32/applicfg.h	Wed Feb 13 16:51:10 2008 +0100
+++ b/include/win32/applicfg.h	Mon Feb 18 10:34:10 2008 +0100
@@ -95,18 +95,20 @@
 // --------------------------------------
 
 #ifdef UNICODE
-  #define CANFESTIVAL_DEBUG_MSG(num, str, val)\
-    {wchar_t msg[300];\
-     unsigned long value = val;\
-     swprintf(msg,L"%s(%d) : 0x%X %s 0x%X\n",__FILE__, __LINE__,num, str, value);\
-     OutputDebugString(msg);}
+#define MSG(...) \
+  do{wchar_t msg[300];\
+   swprintf(msg,L##__VA_ARGS__);\
+   OutputDebugString(msg);}while(0)
 #else
-  #define CANFESTIVAL_DEBUG_MSG(num, str, val)\
-    {char msg[300];\
-     unsigned long value = val;\
-     sprintf(msg,"%s(%d) : 0x%X %s 0x%X\n",__FILE__, __LINE__,num, str, value);\
-     OutputDebugString(msg);}
+#define MSG(...) \
+  do{char msg[300];\
+   sprintf(msg,##__VA_ARGS__);\
+   OutputDebugString(msg);}while(0)
 #endif  
+#define CANFESTIVAL_DEBUG_MSG(num, str, val)\
+  {unsigned long value = val;\
+   MSG("%s(%d) : 0x%X %s 0x%X\n",__FILE__, __LINE__,num, str, value);\
+   }
 
 /// Definition of MSG_WAR
 // ---------------------