]> git.ipfire.org Git - thirdparty/qemu.git/blame - slirp/src/debug.h
build-sys: pass CFLAGS & LDFLAGS to subdir-slirp
[thirdparty/qemu.git] / slirp / src / debug.h
CommitLineData
3e6d35e5 1/* SPDX-License-Identifier: BSD-3-Clause */
f0cbd3ec
FB
2/*
3 * Copyright (c) 1995 Danny Gasparovski.
f0cbd3ec
FB
4 */
5
208408c3
MAL
6#ifndef DEBUG_H_
7#define DEBUG_H_
f0cbd3ec 8
7fce7172
MAL
9#define DBG_CALL (1 << 0)
10#define DBG_MISC (1 << 1)
11#define DBG_ERROR (1 << 2)
12#define DBG_TFTP (1 << 3)
f0cbd3ec 13
9f349498
JK
14extern int slirp_debug;
15
2afbb788 16#define DEBUG_CALL(fmt, ...) do { \
55ef9c61 17 if (G_UNLIKELY(slirp_debug & DBG_CALL)) { \
226ea7a9 18 g_debug(fmt "...", ##__VA_ARGS__); \
2afbb788
MAL
19 } \
20} while (0)
21
22#define DEBUG_ARG(fmt, ...) do { \
55ef9c61 23 if (G_UNLIKELY(slirp_debug & DBG_CALL)) { \
226ea7a9 24 g_debug(" " fmt, ##__VA_ARGS__); \
2afbb788
MAL
25 } \
26} while (0)
27
2afbb788 28#define DEBUG_MISC(fmt, ...) do { \
55ef9c61 29 if (G_UNLIKELY(slirp_debug & DBG_MISC)) { \
226ea7a9 30 g_debug(fmt, ##__VA_ARGS__); \
2afbb788
MAL
31 } \
32} while (0)
33
34#define DEBUG_ERROR(fmt, ...) do { \
55ef9c61 35 if (G_UNLIKELY(slirp_debug & DBG_ERROR)) { \
226ea7a9 36 g_debug(fmt, ##__VA_ARGS__); \
2afbb788
MAL
37 } \
38} while (0)
f0cbd3ec 39
7fce7172
MAL
40#define DEBUG_TFTP(fmt, ...) do { \
41 if (G_UNLIKELY(slirp_debug & DBG_TFTP)) { \
42 g_debug(fmt, ##__VA_ARGS__); \
43 } \
44} while (0)
45
208408c3 46#endif /* DEBUG_H_ */