ReactOS 0.4.15-dev-8127-g6338913
usbdebug.h
Go to the documentation of this file.
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 #ifndef NDEBUG_USBPORT_USB2
116
117 #define DPRINT_USB2(fmt, ...) do { \
118 if (DbgPrint("(%s:%d) " fmt, __RELFILE__, __LINE__, ##__VA_ARGS__)) \
119 DbgPrint("(%s:%d) DbgPrint() failed!\n", __RELFILE__, __LINE__); \
120 } while (0)
121
122 #else
123
124#if defined(_MSC_VER)
125 #define DPRINT_USB2 __noop
126#else
127 #define DPRINT_USB2(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
128#endif
129
130 #endif
131
132#else /* not DBG */
133
134#if defined(_MSC_VER)
135 #define DPRINT_MINIPORT __noop
136 #define DPRINT_CORE __noop
137 #define DPRINT_URB __noop
138 #define DPRINT_INT __noop
139 #define DPRINT_TIMER __noop
140 #define DPRINT_QUEUE __noop
141 #define DPRINT_USB2 __noop
142#else
143 #define DPRINT_MINIPORT(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
144 #define DPRINT_CORE(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
145 #define DPRINT_URB(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
146 #define DPRINT_INT(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
147 #define DPRINT_TIMER(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
148 #define DPRINT_QUEUE(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
149 #define DPRINT_USB2(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
150#endif /* _MSC_VER */
151
152#endif /* not DBG */
153
154#endif /* USBDEBUG_H__ */