Statistics
| Branch: | Revision:

root / slirp / debug.h @ b011f619

History | View | Annotate | Download (865 Bytes)

1 f0cbd3ec bellard
/*
2 f0cbd3ec bellard
 * Copyright (c) 1995 Danny Gasparovski.
3 5fafdf24 ths
 *
4 5fafdf24 ths
 * Please read the file COPYRIGHT for the
5 f0cbd3ec bellard
 * terms and conditions of the copyright.
6 f0cbd3ec bellard
 */
7 f0cbd3ec bellard
8 9f349498 Jan Kiszka
//#define DEBUG 1
9 f0cbd3ec bellard
10 9f349498 Jan Kiszka
#ifdef DEBUG
11 f0cbd3ec bellard
12 f0cbd3ec bellard
#define DBG_CALL 0x1
13 f0cbd3ec bellard
#define DBG_MISC 0x2
14 f0cbd3ec bellard
#define DBG_ERROR 0x4
15 f0cbd3ec bellard
16 9f349498 Jan Kiszka
#define dfd stderr
17 9f349498 Jan Kiszka
18 9f349498 Jan Kiszka
extern int slirp_debug;
19 9f349498 Jan Kiszka
20 f0cbd3ec bellard
#define DEBUG_CALL(x) if (slirp_debug & DBG_CALL) { fprintf(dfd, "%s...\n", x); fflush(dfd); }
21 f0cbd3ec bellard
#define DEBUG_ARG(x, y) if (slirp_debug & DBG_CALL) { fputc(' ', dfd); fprintf(dfd, x, y); fputc('\n', dfd); fflush(dfd); }
22 f0cbd3ec bellard
#define DEBUG_ARGS(x) if (slirp_debug & DBG_CALL) { fprintf x ; fflush(dfd); }
23 f0cbd3ec bellard
#define DEBUG_MISC(x) if (slirp_debug & DBG_MISC) { fprintf x ; fflush(dfd); }
24 f0cbd3ec bellard
#define DEBUG_ERROR(x) if (slirp_debug & DBG_ERROR) {fprintf x ; fflush(dfd); }
25 f0cbd3ec bellard
26 f0cbd3ec bellard
#else
27 f0cbd3ec bellard
28 f0cbd3ec bellard
#define DEBUG_CALL(x)
29 f0cbd3ec bellard
#define DEBUG_ARG(x, y)
30 f0cbd3ec bellard
#define DEBUG_ARGS(x)
31 f0cbd3ec bellard
#define DEBUG_MISC(x)
32 f0cbd3ec bellard
#define DEBUG_ERROR(x)
33 f0cbd3ec bellard
34 f0cbd3ec bellard
#endif