reshuffling of dlls
[reactos.git] / reactos / dll / ws2help / 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 #ifdef ASSERT
21 #undef ASSERT
22 #endif
23
24 #ifdef DBG
25
26 extern DWORD DebugTraceLevel;
27
28 #define WSH_DbgPrint(_t_, _x_) \
29 if (((DebugTraceLevel & NORMAL_MASK) >= _t_) || \
30 ((DebugTraceLevel & _t_) > NORMAL_MASK)) { \
31 DbgPrint("(%hS:%d)(%hS) ", __FILE__, __LINE__, __FUNCTION__); \
32 DbgPrint _x_; \
33 }
34
35 #ifdef NASSERT
36 #define ASSERT(x)
37 #else /* NASSERT */
38 #define ASSERT(x) if (!(x)) { WSH_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); ExitProcess(0); }
39 #endif /* NASSERT */
40
41 #else /* DBG */
42
43 #define WSH_DbgPrint(_t_, _x_)
44
45 #define ASSERT(x)
46
47 #endif /* DBG */
48
49 #undef assert
50 #define assert(x) ASSERT(x)
51 #define assert_irql(x) ASSERT_IRQL(x)
52
53
54 #define UNIMPLEMENTED \
55 WSH_DbgPrint(MIN_TRACE, ("(%s:%d)(%s) is unimplemented, \
56 please try again later.\n", __FILE__, __LINE__, __FUNCTION__));
57
58 #define CHECKPOINT \
59 WSH_DbgPrint(MIN_TRACE, ("\n"));
60
61 #define CP CHECKPOINT
62
63 #endif /* __DEBUG_H */
64
65 /* EOF */