-
Notifications
You must be signed in to change notification settings - Fork 0
/
dbgtrace.h
39 lines (29 loc) · 998 Bytes
/
dbgtrace.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef __DEBUG_TRACE_H__
#define __DEBUG_TRACE_H__
///////////////////////////////////////////////////////////////////////////////
// Debug Information Trace Helper
#ifdef _DEBUG
#include <assert.h>
#include <crtdbg.h>
#define ASSERT(f) assert(f)
#define VERIFY(f) ASSERT(f)
#define TRACE _TRACE
bool IsValidAddress(const void *p, UINT nBytes, BOOL bReadWrite =TRUE);
bool IsValidString(LPCTSTR psz, int nLength =-1);
void INIT_CRT_DEBUG_REPORT();
TCHAR* GetLastErrorMsg();
void _TRACE(LPCWSTR szFormat, ...);
void _TRACE(LPCSTR szFormat, ...);
#else // _DEBUG
#define ASSERT(f) ((void)0)
#define VERIFY(f) ((void)(f))
#define TRACE 1 ? (void)0 : _TRACE
#define IsValidString 1 ? (void)0 : _TRACE
#define IsValidAddress 1 ? (void)0 : _TRACE
#define INIT_CRT_DEBUG_REPORT()
#define GetLastErrorMsg() ""
static inline void _TRACE(LPCWSTR, ...) { }
static inline void _TRACE(LPCSTR, ...) { }
#endif
void OutputDebugPrint(LPCWSTR szFormat, ...);
#endif