include/win32/applicfg.h
changeset 637 c676669ec3c1
parent 407 384c3cd7afa2
child 662 aad111ad0018
equal deleted inserted replaced
636:033fe6f1ec3c 637:c676669ec3c1
    92 #define INT64_2_56(a) (a&0x00FFFFFFFFFFFFFF)
    92 #define INT64_2_56(a) (a&0x00FFFFFFFFFFFFFF)
    93 
    93 
    94 /// Definition of error and warning macros
    94 /// Definition of error and warning macros
    95 // --------------------------------------
    95 // --------------------------------------
    96 
    96 
       
    97 #ifndef _MSC_VER
       
    98 #error This block is for Visual only, please adapt it for your compiler.
       
    99 #elif (_MSC_VER >= 1400)
       
   100 //Visual Studio 2005 and above
    97 #ifdef UNICODE
   101 #ifdef UNICODE
    98 #define MSG(...) \
   102 #define MSG(...) \
    99   do{wchar_t msg[300];\
   103   do{wchar_t msg[300];\
   100    swprintf(msg,L##__VA_ARGS__);\
   104    swprintf(msg,L##__VA_ARGS__);\
   101    OutputDebugString(msg);}while(0)
   105    OutputDebugString(msg);}while(0)
   105 
   109 
   106 /*do{char msg[300];\
   110 /*do{char msg[300];\
   107    sprintf(msg,##__VA_ARGS__);\
   111    sprintf(msg,##__VA_ARGS__);\
   108    OutputDebugString(msg);}while(0)
   112    OutputDebugString(msg);}while(0)
   109 */
   113 */
   110 #endif  
   114 #endif
       
   115 #else //(_MSC_VER < 1400)
       
   116 //For Visual Studio 2003 and below, without VA_ARGS
       
   117 #ifdef UNICODE
       
   118 #define MSG(text) \
       
   119   do{wchar_t msg[300];\
       
   120    vswprintf(msg,L##text);\
       
   121    OutputDebugString(msg);}while(0)
       
   122 #else
       
   123 #define MSG(text) \
       
   124   do{printf text;fflush(stdout);}while(0)
       
   125 #endif
       
   126 
       
   127 #endif //_MSC_VER
       
   128 
   111 #define CANFESTIVAL_DEBUG_MSG(num, str, val)\
   129 #define CANFESTIVAL_DEBUG_MSG(num, str, val)\
   112   {unsigned long value = val;\
   130   {unsigned long value = val;\
   113    MSG("%s(%d) : 0x%X %s 0x%X\n",__FILE__, __LINE__,num, str, value);\
   131    MSG(("%s(%d) : 0x%X %s 0x%lX\n",__FILE__, __LINE__,num, str, value)); \
   114    }
   132    }
   115 
   133 
   116 /// Definition of MSG_WAR
   134 /// Definition of MSG_WAR
   117 // ---------------------
   135 // ---------------------
   118 #ifdef DEBUG_WAR_CONSOLE_ON
   136 #ifdef DEBUG_WAR_CONSOLE_ON