bbd863afc1ea852abe385dd402dc0bd5322f1ceb
[reactos.git] / rosapps / regedit / trace.h
1 /////////////////////////////////////////////////////////////////////////////
2 //
3 #ifndef __TRACE_H__
4 #define __TRACE_H__
5
6 #ifdef _DEBUG
7
8 //=============================================================================
9 // BreakPoint() macro.
10 //=============================================================================
11
12 #ifdef _X86_
13 #define BreakPoint() _asm { int 3h }
14 #else
15 #define BreakPoint() _DebugBreak()
16 #endif
17
18 //=============================================================================
19 // MACRO: ASSERT()
20 //=============================================================================
21
22 #ifndef ASSERT
23 #define ASSERT(exp) \
24 { \
25 if ( !(exp) ) \
26 { \
27 Assert(#exp, __FILE__, __LINE__, NULL); \
28 BreakPoint(); \
29 } \
30 } \
31
32 #define ASSERTMSG(exp, msg) \
33 { \
34 if ( !(exp) ) \
35 { \
36 Assert(#exp, __FILE__, __LINE__, msg); \
37 BreakPoint(); \
38 } \
39 }
40 #endif
41
42 //=============================================================================
43 // MACRO: TRACE()
44 //=============================================================================
45
46 void Assert(void* assert, TCHAR* file, int line, void* msg);
47 void Trace(TCHAR* lpszFormat, ...);
48 void Trace1(int code, TCHAR* lpszFormat, ...);
49
50 #define TRACE Trace
51 #define TRACE0 Trace
52
53 #else // _DEBUG
54
55 #ifndef ASSERT
56 #define ASSERT(exp)
57 #define ASSERTMSG(exp, msg)
58 #endif
59
60 //#define TRACE0 TRACE
61 //#define TRACE1 TRACE
62
63 void Assert(void* assert, TCHAR* file, int line, void* msg);
64 void Trace(TCHAR* lpszFormat, ...);
65
66 #define TRACE 0 ? (void)0 : Trace
67
68
69 #endif // !_DEBUG
70
71 #endif // __TRACE_H__
72 /////////////////////////////////////////////////////////////////////////////