1 /////////////////////////////////////////////////////////////////////////////
7 #define WIN32_LEAN_AND_MEAN
15 //#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
16 //#include <windows.h>
18 //WINBASEAPI VOID WINAPI DebugBreak(VOID);
19 //WINBASEAPI VOID WINAPI OutputDebugStringA(LPCSTR lpOutputString);
20 //WINBASEAPI VOID WINAPI OutputDebugStringW(LPCWSTR lpOutputString);
21 //void __stdcall DebugBreak(void);
22 //void __stdcall OutputDebugStringA(char* lpOutputString);
23 //void __stdcall OutputDebugStringW(wchar_t* lpOutputString);
25 #define OutputDebugString OutputDebugStringW
27 #define OutputDebugString OutputDebugStringA
36 static char THIS_FILE[] = __FILE__;
38 void _DebugBreak(void)
43 void Trace(TCHAR* lpszFormat, ...)
49 va_start(args, lpszFormat);
50 // nBuf = vsprintf(szBuffer, lpszFormat, args);
51 // nBuf = _vsntprintf(szBuffer, _countof(szBuffer), lpszFormat, args);
53 nBuf = _vsnwprintf(szBuffer, sizeof(szBuffer)/sizeof(TCHAR), lpszFormat, args);
55 nBuf = _vsnprintf(szBuffer, sizeof(szBuffer)/sizeof(TCHAR), lpszFormat, args);
57 OutputDebugString(szBuffer);
58 // was there an error? was the expanded string too long?
63 void Assert(void* assert, TCHAR* file, int line, void* msg)
66 printf("ASSERT -- %s occured on line %u of file %s.\n",
69 printf("ASSERT -- %s occured on line %u of file %s: Message = %s.\n",
70 assert, line, file, msg);
77 //inline void Trace(TCHAR* lpszFormat, ...) { };
78 //inline void Assert(void* assert, TCHAR* file, int line, void* msg) { };
79 void Trace(TCHAR* lpszFormat, ...) { };
80 void Assert(void* assert, TCHAR* file, int line, void* msg) { };
83 /////////////////////////////////////////////////////////////////////////////