From: Marc Marí <5.markm...@gmail.com> Modify debug macros as explained in https://lists.gnu.org/archive/html/qemu-devel/2014-04/msg03642.html
Signed-off-by: Marc Marí <5.markm...@gmail.com> --- slirp/bootp.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/slirp/bootp.c b/slirp/bootp.c index b7db9fa..9700bda 100644 --- a/slirp/bootp.c +++ b/slirp/bootp.c @@ -29,13 +29,18 @@ static const uint8_t rfc1533_cookie[] = { RFC1533_COOKIE }; -#ifdef DEBUG -#define DPRINTF(fmt, ...) \ -do if (slirp_debug & DBG_CALL) { fprintf(dfd, fmt, ## __VA_ARGS__); fflush(dfd); } while (0) -#else -#define DPRINTF(fmt, ...) do{}while(0) +#ifndef DEBUG +#define DEBUG 0 #endif +#define DPRINTF(fmt, ...) \ + do { \ + if (DEBUG && (slirp_debug & DBG_CALL)) { \ + fprintf(dfd, fmt, ## __VA_ARGS__); \ + fflush(dfd); \ + } \ + } while (0) + static BOOTPClient *get_new_addr(Slirp *slirp, struct in_addr *paddr, const uint8_t *macaddr) { -- 1.7.10.4