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