1 /////////////////////////////////////////////////////////////////////////////
6 #define WIN32_LEAN_AND_MEAN
14 //#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
15 //#include <windows.h>
17 //WINBASEAPI VOID WINAPI DebugBreak(VOID);
18 //WINBASEAPI VOID WINAPI OutputDebugStringA(LPCSTR lpOutputString);
19 //WINBASEAPI VOID WINAPI OutputDebugStringW(LPCWSTR lpOutputString);
20 //void __stdcall DebugBreak(void);
21 //void __stdcall OutputDebugStringA(char* lpOutputString);
22 //void __stdcall OutputDebugStringW(wchar_t* lpOutputString);
24 #define OutputDebugString OutputDebugStringW
26 #define OutputDebugString OutputDebugStringA
35 static char THIS_FILE[] = __FILE__;
37 void _DebugBreak(void)
42 void Trace(TCHAR* lpszFormat, ...)
48 va_start(args, lpszFormat);
49 // nBuf = vsprintf(szBuffer, lpszFormat, args);
50 // nBuf = _vsntprintf(szBuffer, _countof(szBuffer), lpszFormat, args);
52 nBuf = _vsnwprintf(szBuffer, sizeof(szBuffer)/sizeof(TCHAR), lpszFormat, args);
54 nBuf = _vsnprintf(szBuffer, sizeof(szBuffer)/sizeof(TCHAR), lpszFormat, args);
56 OutputDebugString(szBuffer);
57 // was there an error? was the expanded string too long?
62 void Assert(void* assert, TCHAR* file, int line, void* msg)
65 printf("ASSERT -- %s occured on line %u of file %s.\n",
68 printf("ASSERT -- %s occured on line %u of file %s: Message = %s.\n",
69 assert, line, file, msg);
76 //inline void Trace(TCHAR* lpszFormat, ...) { };
77 //inline void Assert(void* assert, TCHAR* file, int line, void* msg) { };
78 void Trace(TCHAR* lpszFormat, ...) { };
79 void Assert(void* assert, TCHAR* file, int line, void* msg) { };
82 /////////////////////////////////////////////////////////////////////////////