qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 04/14] isa: Convert conditional compilation of debug


From: Marc Marí
Subject: [Qemu-devel] [PATCH 04/14] isa: Convert conditional compilation of debug printfs to regular ifs
Date: Mon, 28 Apr 2014 10:26:05 +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>
---
 hw/isa/vt82c686.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
index 1a93afd..290b946 100644
--- a/hw/isa/vt82c686.c
+++ b/hw/isa/vt82c686.c
@@ -26,14 +26,19 @@
 #include "qemu/timer.h"
 #include "exec/address-spaces.h"
 
-//#define DEBUG_VT82C686B
+//#define DEBUG_VT82C686B 1
 
-#ifdef DEBUG_VT82C686B
-#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __FUNCTION__, 
##__VA_ARGS__)
-#else
-#define DPRINTF(fmt, ...)
+#ifndef DEBUG_VT82C686B
+#define DEBUG_VT82C686B 0
 #endif
 
+#define DPRINTF(fmt, ...) \
+    do { \
+        if(DEBUG_VT82C686B) { \
+            fprintf(stderr, "%s: " fmt, __FUNCTION__, ##__VA_ARGS__); \
+        } \
+    } while(0)
+
 typedef struct SuperIOConfig
 {
     uint8_t config[0xff];
-- 
1.7.10.4




reply via email to

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