]> git.ipfire.org Git - thirdparty/qemu.git/blob - slirp/src/debug.h
2e503ad7fa6b0fb83c76154707f2c3cfba2ee32d
[thirdparty/qemu.git] / slirp / src / debug.h
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3 * Copyright (c) 1995 Danny Gasparovski.
4 *
5 * Please read the file COPYRIGHT for the
6 * terms and conditions of the copyright.
7 */
8
9 #ifndef DEBUG_H_
10 #define DEBUG_H_
11
12 #define DBG_CALL (1 << 0)
13 #define DBG_MISC (1 << 1)
14 #define DBG_ERROR (1 << 2)
15 #define DBG_TFTP (1 << 3)
16
17 extern int slirp_debug;
18
19 #define DEBUG_CALL(fmt, ...) do { \
20 if (G_UNLIKELY(slirp_debug & DBG_CALL)) { \
21 g_debug(fmt "...", ##__VA_ARGS__); \
22 } \
23 } while (0)
24
25 #define DEBUG_ARG(fmt, ...) do { \
26 if (G_UNLIKELY(slirp_debug & DBG_CALL)) { \
27 g_debug(" " fmt, ##__VA_ARGS__); \
28 } \
29 } while (0)
30
31 #define DEBUG_MISC(fmt, ...) do { \
32 if (G_UNLIKELY(slirp_debug & DBG_MISC)) { \
33 g_debug(fmt, ##__VA_ARGS__); \
34 } \
35 } while (0)
36
37 #define DEBUG_ERROR(fmt, ...) do { \
38 if (G_UNLIKELY(slirp_debug & DBG_ERROR)) { \
39 g_debug(fmt, ##__VA_ARGS__); \
40 } \
41 } while (0)
42
43 #define DEBUG_TFTP(fmt, ...) do { \
44 if (G_UNLIKELY(slirp_debug & DBG_TFTP)) { \
45 g_debug(fmt, ##__VA_ARGS__); \
46 } \
47 } while (0)
48
49 #endif /* DEBUG_H_ */