[NTFS] - Add some fixes and improvements to attribute.c from CR-123:
[reactos.git] / drivers / usb / usbport / usbdebug.h
1 /*
2 * PROJECT: ReactOS USB Port Driver
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: USBPort debugging declarations
5 * COPYRIGHT: Copyright 2017 Vadim Galyant <vgal@rambler.ru>
6 */
7
8 #ifndef USBDEBUG_H__
9 #define USBDEBUG_H__
10
11 #if DBG
12
13 #ifndef NDEBUG_USBPORT_MINIPORT
14
15 #define DPRINT_MINIPORT(fmt, ...) do { \
16 if (DbgPrint("(%s:%d) " fmt, __RELFILE__, __LINE__, ##__VA_ARGS__)) \
17 DbgPrint("(%s:%d) DbgPrint() failed!\n", __RELFILE__, __LINE__); \
18 } while (0)
19
20 #else
21
22 #if defined(_MSC_VER)
23 #define DPRINT_MINIPORT __noop
24 #else
25 #define DPRINT_MINIPORT(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
26 #endif
27
28 #endif
29
30 #ifndef NDEBUG_USBPORT_CORE
31
32 #define DPRINT_CORE(fmt, ...) do { \
33 if (DbgPrint("(%s:%d) " fmt, __RELFILE__, __LINE__, ##__VA_ARGS__)) \
34 DbgPrint("(%s:%d) DbgPrint() failed!\n", __RELFILE__, __LINE__); \
35 } while (0)
36
37 #else
38
39 #if defined(_MSC_VER)
40 #define DPRINT_CORE __noop
41 #else
42 #define DPRINT_CORE(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
43 #endif
44
45 #endif
46
47 #ifndef NDEBUG_USBPORT_URB
48
49 #define DPRINT_URB(fmt, ...) do { \
50 if (DbgPrint("(%s:%d) " fmt, __RELFILE__, __LINE__, ##__VA_ARGS__)) \
51 DbgPrint("(%s:%d) DbgPrint() failed!\n", __RELFILE__, __LINE__); \
52 } while (0)
53
54 #else
55
56 #if defined(_MSC_VER)
57 #define DPRINT_URB __noop
58 #else
59 #define DPRINT_URB(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
60 #endif
61
62 #endif
63
64 #ifndef NDEBUG_USBPORT_INTERRUPT
65
66 #define DPRINT_INT(fmt, ...) do { \
67 if (DbgPrint("(%s:%d) " fmt, __RELFILE__, __LINE__, ##__VA_ARGS__)) \
68 DbgPrint("(%s:%d) DbgPrint() failed!\n", __RELFILE__, __LINE__); \
69 } while (0)
70
71 #else
72
73 #if defined(_MSC_VER)
74 #define DPRINT_INT __noop
75 #else
76 #define DPRINT_INT(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
77 #endif
78
79 #endif
80
81 #ifndef NDEBUG_USBPORT_TIMER
82
83 #define DPRINT_TIMER(fmt, ...) do { \
84 if (DbgPrint("(%s:%d) " fmt, __RELFILE__, __LINE__, ##__VA_ARGS__)) \
85 DbgPrint("(%s:%d) DbgPrint() failed!\n", __RELFILE__, __LINE__); \
86 } while (0)
87
88 #else
89
90 #if defined(_MSC_VER)
91 #define DPRINT_TIMER __noop
92 #else
93 #define DPRINT_TIMER(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
94 #endif
95
96 #endif
97
98 #ifndef NDEBUG_USBPORT_QUEUE
99
100 #define DPRINT_QUEUE(fmt, ...) do { \
101 if (DbgPrint("(%s:%d) " fmt, __RELFILE__, __LINE__, ##__VA_ARGS__)) \
102 DbgPrint("(%s:%d) DbgPrint() failed!\n", __RELFILE__, __LINE__); \
103 } while (0)
104
105 #else
106
107 #if defined(_MSC_VER)
108 #define DPRINT_QUEUE __noop
109 #else
110 #define DPRINT_QUEUE(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
111 #endif
112
113 #endif
114
115 #else /* not DBG */
116
117 #if defined(_MSC_VER)
118 #define DPRINT_MINIPORT __noop
119 #define DPRINT_CORE __noop
120 #define DPRINT_URB __noop
121 #define DPRINT_INT __noop
122 #define DPRINT_TIMER __noop
123 #define DPRINT_QUEUE __noop
124 #else
125 #define DPRINT_MINIPORT(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
126 #define DPRINT_CORE(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
127 #define DPRINT_URB(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
128 #define DPRINT_INT(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
129 #define DPRINT_TIMER(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
130 #define DPRINT_QUEUE(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
131 #endif /* _MSC_VER */
132
133 #endif /* not DBG */
134
135 #endif /* USBDEBUG_H__ */