xref: /reactos/drivers/usb/usbuhci/dbg_uhci.h (revision 98e8827a)
1 /*
2  * PROJECT:     ReactOS USB UHCI Miniport Driver
3  * LICENSE:     GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE:     USBUHCI debugging declarations
5  * COPYRIGHT:   Copyright 2017-2018 Vadim Galyant <vgal@rambler.ru>
6  */
7 
8 #ifndef DBG_UHCI_H__
9 #define DBG_UHCI_H__
10 
11 #if DBG
12 
13     #ifndef NDEBUG_UHCI_TRACE
14         #define DPRINT_UHCI(fmt, ...) do { \
15             if (DbgPrint("(%s:%d) " fmt, __RELFILE__, __LINE__, ##__VA_ARGS__))  \
16                 DbgPrint("(%s:%d) DbgPrint() failed!\n", __RELFILE__, __LINE__); \
17         } while (0)
18     #else
19         #if defined(_MSC_VER)
20             #define DPRINT_UHCI  __noop
21         #else
22             #define DPRINT_UHCI(...) do {if(0) {DbgPrint(__VA_ARGS__);}} while(0)
23         #endif
24     #endif
25 
26     #ifndef NDEBUG_UHCI_IMPLEMENT
27 
28         #define DPRINT_IMPL(fmt, ...) do { \
29             if (DbgPrint("(%s:%d) " fmt, __RELFILE__, __LINE__, ##__VA_ARGS__))  \
30                 DbgPrint("(%s:%d) DbgPrint() failed!\n", __RELFILE__, __LINE__); \
31         } while (0)
32 
33     #else
34 
35         #if defined(_MSC_VER)
36             #define DPRINT_IMPL  __noop
37         #else
38             #define DPRINT_IMPL(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
39         #endif
40 
41     #endif
42 
43 
44 #else /* not DBG */
45 
46     #if defined(_MSC_VER)
47         #define DPRINT_UHCI  __noop
48         #define DPRINT_IMPL  __noop
49     #else
50         #define DPRINT_UHCI(...) do {if(0) {DbgPrint(__VA_ARGS__);}} while(0)
51         #define DPRINT_IMPL(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
52     #endif /* _MSC_VER */
53 
54 #endif /* not DBG */
55 
56 #endif /* DBG_UHCI_H__ */
57