reshuffling of dlls
[reactos.git] / reactos / dll / snmpapi / debug.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS WinSock 2 Helper DLL for TCP/IP
4 * FILE: include/debug.h
5 * PURPOSE: Debugging support macros
6 * DEFINES: DBG - Enable debug output
7 * NASSERT - Disable assertions
8 */
9 #ifndef __DEBUG_H
10 #define __DEBUG_H
11
12 #define NORMAL_MASK 0x000000FF
13 #define SPECIAL_MASK 0xFFFFFF00
14 #define MIN_TRACE 0x00000001
15 #define MID_TRACE 0x00000002
16 #define MAX_TRACE 0x00000003
17
18 #define DEBUG_ULTRA 0xFFFFFFFF
19
20 ULONG DbgPrint(PCH Format,...);
21
22 #ifdef DBG
23
24 extern DWORD DebugTraceLevel;
25
26 #define WSH_DbgPrint(_t_, _x_) \
27 if (((DebugTraceLevel & NORMAL_MASK) >= _t_) || \
28 ((DebugTraceLevel & _t_) > NORMAL_MASK)) { \
29 DbgPrint("(%hS:%d)(%hS) ", __FILE__, __LINE__, __FUNCTION__); \
30 DbgPrint _x_; \
31 }
32
33 #ifdef ASSERT
34 #undef ASSERT
35 #endif
36
37 #ifdef NASSERT
38 #define ASSERT(x)
39 #else /* NASSERT */
40 #define ASSERT(x) if (!(x)) { WSH_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); ExitProcess(0); }
41 #endif /* NASSERT */
42
43 #else /* DBG */
44
45 #define WSH_DbgPrint(_t_, _x_)
46
47 #define ASSERT(x)
48
49 #endif /* DBG */
50
51
52 #define assert(x) ASSERT(x)
53 #define assert_irql(x) ASSERT_IRQL(x)
54
55
56 #define UNIMPLEMENTED \
57 WSH_DbgPrint(MIN_TRACE, ("(%s:%d)(%s) is unimplemented, \
58 please try again later.\n", __FILE__, __LINE__, __FUNCTION__));
59
60 #define CHECKPOINT \
61 WSH_DbgPrint(MIN_TRACE, ("\n"));
62
63 #define CP CHECKPOINT
64
65 #endif /* __DEBUG_H */
66
67 /* EOF */