qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 11/14] slirp: Convert conditional compilation of deb


From: Marc Marí
Subject: [Qemu-devel] [PATCH 11/14] slirp: Convert conditional compilation of debug printfs to regular ifs
Date: Mon, 28 Apr 2014 10:26:12 +0200

From: Marc Marí <address@hidden>

Modify debug macros as explained in 
https://lists.gnu.org/archive/html/qemu-devel/2014-04/msg03642.html

Signed-off-by: Marc Marí <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]