MS DDK compatibility fixes.
[reactos.git] / reactos / drivers / net / ndis / include / debug.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS NDIS library
4 * FILE: include/debug.h
5 * PURPOSE: Debugging support macros
6 * DEFINES: DBG - Enable debug output
7 */
8 #ifndef __DEBUG_H
9 #define __DEBUG_H
10
11 #define NORMAL_MASK 0x000000FF
12 #define SPECIAL_MASK 0xFFFFFF00
13 #define MIN_TRACE 0x00000001
14 #define MID_TRACE 0x00000002
15 #define MAX_TRACE 0x00000003
16
17 #define DEBUG_REFCOUNT 0x00000100
18 #define DEBUG_MINIPORT 0x00000200
19 #define DEBUG_PROTOCOL 0x00000400
20 #define DEBUG_PACKET 0x00000800
21 #define DEBUG_ULTRA 0xFFFFFFFF
22
23 #ifdef DBG
24
25 extern ULONG DebugTraceLevel;
26
27 #ifdef _MSC_VER
28
29 #define NDIS_DbgPrint(_t_, _x_) \
30 if (((DebugTraceLevel & NORMAL_MASK) >= _t_) || \
31 ((DebugTraceLevel & _t_) > NORMAL_MASK)) { \
32 DbgPrint("(%s:%d) ", __FILE__, __LINE__); \
33 DbgPrint _x_ ; \
34 }
35
36 #else /* _MSC_VER */
37
38 #define NDIS_DbgPrint(_t_, _x_) \
39 if (((DebugTraceLevel & NORMAL_MASK) >= _t_) || \
40 ((DebugTraceLevel & _t_) > NORMAL_MASK)) { \
41 DbgPrint("(%s:%d)(%s) ", __FILE__, __LINE__, __FUNCTION__); \
42 DbgPrint _x_ ; \
43 }
44
45 #endif /* _MSC_VER */
46
47 #define ASSERT_IRQL(x) ASSERT(KeGetCurrentIrql() <= (x))
48
49 #else /* DBG */
50
51 #define NDIS_DbgPrint(_t_, _x_)
52
53 #define ASSERT_IRQL(x)
54 /*#define ASSERT(x)*/
55
56 #endif /* DBG */
57
58
59 #define assert(x) ASSERT(x)
60 #define assert_irql(x) ASSERT_IRQL(x)
61
62
63 #ifdef _MSC_VER
64
65 #define UNIMPLEMENTED \
66 NDIS_DbgPrint(MIN_TRACE, ("The function at (%s:%d) is unimplemented.\n", __FILE__, __LINE__));
67
68 #else /* _MSC_VER */
69
70 #define UNIMPLEMENTED \
71 NDIS_DbgPrint(MIN_TRACE, ("(%s) at (%s:%d) is unimplemented.\n", __FUNCTION__, __FILE__, __LINE__));
72
73 #endif /* _MSC_VER */
74
75
76 #define CHECKPOINT \
77 do { NDIS_DbgPrint(MIN_TRACE, ("(%s:%d)\n", __FILE__, __LINE__)); } while(0);
78
79 #define CP CHECKPOINT
80
81 #endif /* __DEBUG_H */
82
83 /* EOF */