9f686bd200af83fb2419c2d54294224dbebc7015
1 /////////////////////////////////////////////////////////////////////////////
6 #define WIN32_LEAN_AND_MEAN
10 DeclAssertFile
; // Should be added at the begining of each .C/.CPP
16 //#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
17 //#include <windows.h>
19 //WINBASEAPI VOID WINAPI DebugBreak(VOID);
20 //WINBASEAPI VOID WINAPI OutputDebugStringA(LPCSTR lpOutputString);
21 //WINBASEAPI VOID WINAPI OutputDebugStringW(LPCWSTR lpOutputString);
22 //void __stdcall DebugBreak(void);
23 //void __stdcall OutputDebugStringA(char* lpOutputString);
24 //void __stdcall OutputDebugStringW(wchar_t* lpOutputString);
26 #define OutputDebugString OutputDebugStringW
28 #define OutputDebugString OutputDebugStringA
37 static char THIS_FILE
[] = __FILE__
;
39 void _DebugBreak(void)
44 void Trace(TCHAR
* lpszFormat
, ...)
50 va_start(args
, lpszFormat
);
51 // nBuf = vsprintf(szBuffer, lpszFormat, args);
52 // nBuf = _vsntprintf(szBuffer, _countof(szBuffer), lpszFormat, args);
54 nBuf
= _vsnwprintf(szBuffer
, sizeof(szBuffer
)/sizeof(TCHAR
), lpszFormat
, args
);
56 nBuf
= _vsnprintf(szBuffer
, sizeof(szBuffer
)/sizeof(TCHAR
), lpszFormat
, args
);
58 OutputDebugString(szBuffer
);
59 // was there an error? was the expanded string too long?
64 void Assert(void* assert, TCHAR
* file
, int line
, void* msg
)
67 printf("ASSERT -- %s occured on line %u of file %s.\n",
70 printf("ASSERT -- %s occured on line %u of file %s: Message = %s.\n",
71 assert, line
, file
, msg
);
78 //inline void Trace(TCHAR* lpszFormat, ...) { };
79 //inline void Assert(void* assert, TCHAR* file, int line, void* msg) { };
80 void Trace(TCHAR
* lpszFormat
, ...) { };
81 void Assert(void* assert, TCHAR
* file
, int line
, void* msg
) { };
84 /////////////////////////////////////////////////////////////////////////////