diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2019-02-12 17:25:21 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2019-03-07 12:46:31 +0100 |
commit | c2d63650d962612cfa1b21302782d4cd12142c74 (patch) | |
tree | 13f97c3ecbf6a6588f579e9f7c2ab9cb5f3ce5ec /slirp/src/debug.h | |
parent | 5a4af0d4ee6084fdfde0125c45181fa0e6f48a17 (diff) |
slirp: move sources to src/ subdirectory
Prepare for making slirp/ a standalone project.
Remove some useless includes while at it.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20190212162524.31504-5-marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'slirp/src/debug.h')
-rw-r--r-- | slirp/src/debug.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/slirp/src/debug.h b/slirp/src/debug.h new file mode 100644 index 0000000000..44d922df37 --- /dev/null +++ b/slirp/src/debug.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 1995 Danny Gasparovski. + * + * Please read the file COPYRIGHT for the + * terms and conditions of the copyright. + */ + +#ifndef DEBUG_H_ +#define DEBUG_H_ + +#define DBG_CALL (1 << 0) +#define DBG_MISC (1 << 1) +#define DBG_ERROR (1 << 2) +#define DBG_TFTP (1 << 3) + +extern int slirp_debug; + +#define DEBUG_CALL(fmt, ...) do { \ + if (G_UNLIKELY(slirp_debug & DBG_CALL)) { \ + g_debug(fmt "...", ##__VA_ARGS__); \ + } \ +} while (0) + +#define DEBUG_ARG(fmt, ...) do { \ + if (G_UNLIKELY(slirp_debug & DBG_CALL)) { \ + g_debug(" " fmt, ##__VA_ARGS__); \ + } \ +} while (0) + +#define DEBUG_MISC(fmt, ...) do { \ + if (G_UNLIKELY(slirp_debug & DBG_MISC)) { \ + g_debug(fmt, ##__VA_ARGS__); \ + } \ +} while (0) + +#define DEBUG_ERROR(fmt, ...) do { \ + if (G_UNLIKELY(slirp_debug & DBG_ERROR)) { \ + g_debug(fmt, ##__VA_ARGS__); \ + } \ +} while (0) + +#define DEBUG_TFTP(fmt, ...) do { \ + if (G_UNLIKELY(slirp_debug & DBG_TFTP)) { \ + g_debug(fmt, ##__VA_ARGS__); \ + } \ +} while (0) + +#endif /* DEBUG_H_ */ |