ReactOS 0.4.15-dev-7674-gc0b4db1
trace.h
Go to the documentation of this file.
1
2// Diagnostic Trace
3//
4#ifndef __TRACE_H__
5#define __TRACE_H__
6
7#ifdef _DEBUG
8
9#ifdef _X86_
10#define BreakPoint() _asm { int 3h }
11#else
12#define BreakPoint() _DebugBreak()
13#endif
14
15#ifndef ASSERT
16#define ASSERT(exp) \
17{ \
18 if (!(exp)) { \
19 Assert(#exp, __FILE__, __LINE__, NULL); \
20 BreakPoint(); \
21 } \
22} \
23
24#define ASSERTMSG(msg, exp) \
25{ \
26 if (!(exp)) { \
27 Assert(#exp, __FILE__, __LINE__, msg); \
28 BreakPoint(); \
29 } \
30}
31#endif
32
33//=============================================================================
34// MACRO: TRACE()
35//=============================================================================
36
37#define TRACE Trace
38
39
40#else // _DEBUG
41
42//=============================================================================
43// Define away MACRO's ASSERT() and TRACE() in non debug builds
44//=============================================================================
45
46#ifndef ASSERT
47#define ASSERT(exp)
48#define ASSERTMSG(msg, exp)
49#endif
50
51#define TRACE 0 ? (void)0 : Trace
52
53#endif // !_DEBUG
54
55
56void Assert(void* assert, TCHAR* file, int line, void* msg);
57void Trace(TCHAR* lpszFormat, ...);
58
59
60#endif // __TRACE_H__
#define msg(x)
Definition: auth_time.c:54
#define Assert(cond, msg)
Definition: inflate.c:41
#define Trace(x)
Definition: inflate.c:42
#define assert(x)
Definition: debug.h:53
Definition: fci.c:127
Definition: parser.c:49
char TCHAR
Definition: xmlstorage.h:189