# HG changeset patch # User Christian Taedcke # Date 1284040202 -7200 # Node ID c676669ec3c1910e77e2a8eca6c6dc6568f51c5f # Parent 033fe6f1ec3c6360e6596230936920d23b473bcb CHANGED: - enabled console debugging for Visual Studio 2003 and below (without __VA_ARGS__). diff -r 033fe6f1ec3c -r c676669ec3c1 include/win32/applicfg.h --- a/include/win32/applicfg.h Thu Sep 09 15:56:06 2010 +0200 +++ b/include/win32/applicfg.h Thu Sep 09 15:50:02 2010 +0200 @@ -94,6 +94,10 @@ /// Definition of error and warning macros // -------------------------------------- +#ifndef _MSC_VER +#error This block is for Visual only, please adapt it for your compiler. +#elif (_MSC_VER >= 1400) +//Visual Studio 2005 and above #ifdef UNICODE #define MSG(...) \ do{wchar_t msg[300];\ @@ -107,10 +111,24 @@ sprintf(msg,##__VA_ARGS__);\ OutputDebugString(msg);}while(0) */ -#endif +#endif +#else //(_MSC_VER < 1400) +//For Visual Studio 2003 and below, without VA_ARGS +#ifdef UNICODE +#define MSG(text) \ + do{wchar_t msg[300];\ + vswprintf(msg,L##text);\ + OutputDebugString(msg);}while(0) +#else +#define MSG(text) \ + do{printf text;fflush(stdout);}while(0) +#endif + +#endif //_MSC_VER + #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);\ + MSG(("%s(%d) : 0x%X %s 0x%lX\n",__FILE__, __LINE__,num, str, value)); \ } /// Definition of MSG_WAR