2004-04-22 00:10:48 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 1995 Danny Gasparovski.
|
2007-09-16 21:08:06 +00:00
|
|
|
*
|
|
|
|
* Please read the file COPYRIGHT for the
|
2004-04-22 00:10:48 +00:00
|
|
|
* terms and conditions of the copyright.
|
|
|
|
*/
|
|
|
|
|
2018-11-21 22:06:36 +00:00
|
|
|
#ifndef DEBUG_H_
|
|
|
|
#define DEBUG_H_
|
2004-04-22 00:10:48 +00:00
|
|
|
|
|
|
|
#define DBG_CALL 0x1
|
|
|
|
#define DBG_MISC 0x2
|
|
|
|
#define DBG_ERROR 0x4
|
|
|
|
|
2009-06-24 12:42:29 +00:00
|
|
|
extern int slirp_debug;
|
|
|
|
|
2018-11-14 12:36:31 +00:00
|
|
|
#define DEBUG_CALL(fmt, ...) do { \
|
2018-11-21 22:40:34 +00:00
|
|
|
if (G_UNLIKELY(slirp_debug & DBG_CALL)) { \
|
2018-11-21 22:06:41 +00:00
|
|
|
g_debug(fmt "...", ##__VA_ARGS__); \
|
2018-11-14 12:36:31 +00:00
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define DEBUG_ARG(fmt, ...) do { \
|
2018-11-21 22:40:34 +00:00
|
|
|
if (G_UNLIKELY(slirp_debug & DBG_CALL)) { \
|
2018-11-21 22:06:41 +00:00
|
|
|
g_debug(" " fmt, ##__VA_ARGS__); \
|
2018-11-14 12:36:31 +00:00
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define DEBUG_MISC(fmt, ...) do { \
|
2018-11-21 22:40:34 +00:00
|
|
|
if (G_UNLIKELY(slirp_debug & DBG_MISC)) { \
|
2018-11-21 22:06:41 +00:00
|
|
|
g_debug(fmt, ##__VA_ARGS__); \
|
2018-11-14 12:36:31 +00:00
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define DEBUG_ERROR(fmt, ...) do { \
|
2018-11-21 22:40:34 +00:00
|
|
|
if (G_UNLIKELY(slirp_debug & DBG_ERROR)) { \
|
2018-11-21 22:06:41 +00:00
|
|
|
g_debug(fmt, ##__VA_ARGS__); \
|
2018-11-14 12:36:31 +00:00
|
|
|
} \
|
|
|
|
} while (0)
|
2004-04-22 00:10:48 +00:00
|
|
|
|
2018-11-21 22:06:36 +00:00
|
|
|
#endif /* DEBUG_H_ */
|