Win32 applconfig:
authorChristian Taedcke <hacking@taedcke.com>
Tue, 08 Nov 2011 08:27:42 +0000
changeset 684 3804ee7f9030
parent 683 a3ff0e3e9829
child 685 b38d2d8e291d
Win32 applconfig:
CHANGED: - The MSG()-Makros for Visual Studio both print now to OutputDebugString().
ADDED: - Makro CANFESTIVAL_DEBUG_DRV_MSG() and MSG_ERR_DRV() to print into MSG() from a can driver implementation.
include/win32/applicfg.h
--- a/include/win32/applicfg.h	Tue Nov 08 08:27:29 2011 +0000
+++ b/include/win32/applicfg.h	Tue Nov 08 08:27:42 2011 +0000
@@ -106,12 +106,9 @@
    OutputDebugString(msg);}while(0)
 #else
 #define MSG(...) \
-  do{printf(__VA_ARGS__);fflush(stdout);}while(0)
-
-/*do{char msg[300];\
+do{char msg[300];\
    sprintf(msg,##__VA_ARGS__);\
    OutputDebugString(msg);}while(0)
-*/
 #endif
 #else //(_MSC_VER < 1400)
 //For Visual Studio 2003 and below, without VA_ARGS
@@ -132,6 +129,9 @@
    MSG(("%s(%d) : 0x%X %s 0x%lX\n",__FILE__, __LINE__,num, str, value)); \
    }
 
+#define CANFESTIVAL_DEBUG_DRV_MSG(...)\
+  MSG(__VA_ARGS__);
+
 /// Definition of MSG_WAR
 // ---------------------
 #ifdef DEBUG_WAR_CONSOLE_ON
@@ -148,6 +148,11 @@
 #    define MSG_ERR(num, str, val)
 #endif
 
+#ifdef DEBUG_ERR_DRIVER_CONSOLE_ON
+#    define MSG_ERR_DRV(...) CANFESTIVAL_DEBUG_DRV_MSG(__VA_ARGS__)
+#else
+#    define MSG_ERR_DRV(...)
+#endif
 
 
 typedef void* CAN_HANDLE;