1
2
3
4
5
6#ifndef DEBUG_H_
7#define DEBUG_H_
8
9#define DBG_CALL (1 << 0)
10#define DBG_MISC (1 << 1)
11#define DBG_ERROR (1 << 2)
12#define DBG_TFTP (1 << 3)
13
14extern int slirp_debug;
15
16#define DEBUG_CALL(fmt, ...) do { \
17 if (G_UNLIKELY(slirp_debug & DBG_CALL)) { \
18 g_debug(fmt "...", ##__VA_ARGS__); \
19 } \
20} while (0)
21
22#define DEBUG_ARG(fmt, ...) do { \
23 if (G_UNLIKELY(slirp_debug & DBG_CALL)) { \
24 g_debug(" " fmt, ##__VA_ARGS__); \
25 } \
26} while (0)
27
28#define DEBUG_MISC(fmt, ...) do { \
29 if (G_UNLIKELY(slirp_debug & DBG_MISC)) { \
30 g_debug(fmt, ##__VA_ARGS__); \
31 } \
32} while (0)
33
34#define DEBUG_ERROR(fmt, ...) do { \
35 if (G_UNLIKELY(slirp_debug & DBG_ERROR)) { \
36 g_debug(fmt, ##__VA_ARGS__); \
37 } \
38} while (0)
39
40#define DEBUG_TFTP(fmt, ...) do { \
41 if (G_UNLIKELY(slirp_debug & DBG_TFTP)) { \
42 g_debug(fmt, ##__VA_ARGS__); \
43 } \
44} while (0)
45
46#endif
47