equal
deleted
inserted
replaced
100 #elif (_MSC_VER >= 1400) |
100 #elif (_MSC_VER >= 1400) |
101 //Visual Studio 2005 and above |
101 //Visual Studio 2005 and above |
102 #ifdef UNICODE |
102 #ifdef UNICODE |
103 #define MSG(...) \ |
103 #define MSG(...) \ |
104 do{wchar_t msg[300];\ |
104 do{wchar_t msg[300];\ |
105 swprintf(msg,L##__VA_ARGS__);\ |
105 swprintf(msg,sizeof(msg)/sizeof(msg[0]), L##__VA_ARGS__); \ |
106 OutputDebugString(msg);}while(0) |
106 OutputDebugString(msg);}while(0) |
107 #else |
107 #else |
108 #define MSG(...) \ |
108 #define MSG(...) \ |
109 do{printf(__VA_ARGS__);fflush(stdout);}while(0) |
109 do{char msg[300];\ |
110 |
|
111 /*do{char msg[300];\ |
|
112 sprintf(msg,##__VA_ARGS__);\ |
110 sprintf(msg,##__VA_ARGS__);\ |
113 OutputDebugString(msg);}while(0) |
111 OutputDebugString(msg);}while(0) |
114 */ |
|
115 #endif |
112 #endif |
116 #else //(_MSC_VER < 1400) |
113 #else //(_MSC_VER < 1400) |
117 //For Visual Studio 2003 and below, without VA_ARGS |
114 //For Visual Studio 2003 and below, without VA_ARGS |
118 #ifdef UNICODE |
115 #ifdef UNICODE |
119 #define MSG(text) \ |
116 #define MSG(text) \ |
130 #define CANFESTIVAL_DEBUG_MSG(num, str, val)\ |
127 #define CANFESTIVAL_DEBUG_MSG(num, str, val)\ |
131 {unsigned long value = val;\ |
128 {unsigned long value = val;\ |
132 MSG(("%s(%d) : 0x%X %s 0x%lX\n",__FILE__, __LINE__,num, str, value)); \ |
129 MSG(("%s(%d) : 0x%X %s 0x%lX\n",__FILE__, __LINE__,num, str, value)); \ |
133 } |
130 } |
134 |
131 |
|
132 #define CANFESTIVAL_DEBUG_DRV_MSG(...)\ |
|
133 MSG(__VA_ARGS__); |
|
134 |
135 /// Definition of MSG_WAR |
135 /// Definition of MSG_WAR |
136 // --------------------- |
136 // --------------------- |
137 #ifdef DEBUG_WAR_CONSOLE_ON |
137 #ifdef DEBUG_WAR_CONSOLE_ON |
138 #define MSG_WAR(num, str, val) CANFESTIVAL_DEBUG_MSG(num, str, val) |
138 #define MSG_WAR(num, str, val) CANFESTIVAL_DEBUG_MSG(num, str, val) |
139 #else |
139 #else |
146 # define MSG_ERR(num, str, val) CANFESTIVAL_DEBUG_MSG(num, str, val) |
146 # define MSG_ERR(num, str, val) CANFESTIVAL_DEBUG_MSG(num, str, val) |
147 #else |
147 #else |
148 # define MSG_ERR(num, str, val) |
148 # define MSG_ERR(num, str, val) |
149 #endif |
149 #endif |
150 |
150 |
|
151 #ifdef DEBUG_ERR_DRIVER_CONSOLE_ON |
|
152 # define MSG_ERR_DRV(...) CANFESTIVAL_DEBUG_DRV_MSG(__VA_ARGS__) |
|
153 #else |
|
154 # define MSG_ERR_DRV(...) |
|
155 #endif |
151 |
156 |
152 |
157 |
153 typedef void* CAN_HANDLE; |
158 typedef void* CAN_HANDLE; |
154 |
159 |
155 typedef void* CAN_PORT; |
160 typedef void* CAN_PORT; |