slirp: call into g_debug() for DEBUG macros
[qemu/ar7.git] / slirp / debug.h
blob25a5d59439a768b6c557f71928a3150895cf86c0
1 /*
2 * Copyright (c) 1995 Danny Gasparovski.
4 * Please read the file COPYRIGHT for the
5 * terms and conditions of the copyright.
6 */
8 #ifndef DEBUG_H_
9 #define DEBUG_H_
11 #define DBG_CALL 0x1
12 #define DBG_MISC 0x2
13 #define DBG_ERROR 0x4
15 extern int slirp_debug;
17 #define DEBUG_CALL(fmt, ...) do { \
18 if (slirp_debug & DBG_CALL) { \
19 g_debug(fmt "...", ##__VA_ARGS__); \
20 } \
21 } while (0)
23 #define DEBUG_ARG(fmt, ...) do { \
24 if (slirp_debug & DBG_CALL) { \
25 g_debug(" " fmt, ##__VA_ARGS__); \
26 } \
27 } while (0)
29 #define DEBUG_MISC(fmt, ...) do { \
30 if (slirp_debug & DBG_MISC) { \
31 g_debug(fmt, ##__VA_ARGS__); \
32 } \
33 } while (0)
35 #define DEBUG_ERROR(fmt, ...) do { \
36 if (slirp_debug & DBG_ERROR) { \
37 g_debug(fmt, ##__VA_ARGS__); \
38 } \
39 } while (0)
41 #endif /* DEBUG_H_ */