qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH v3 01/16] include/qemu-common.h: Add QEMU_DPRINTF ma


From: Marc Marí
Subject: [Qemu-devel] [PATCH v3 01/16] include/qemu-common.h: Add QEMU_DPRINTF macro
Date: Sun, 18 May 2014 01:03:28 +0200

Create this macro to let debug macros to have the same format through the
codebase and use regular ifs instead of ifdef.

Signed-off-by: Marc Marí <address@hidden>
---
 include/qemu-common.h |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/qemu-common.h b/include/qemu-common.h
index 3f3fd60..acdcf08 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -463,3 +463,10 @@ int parse_debug_env(const char *name, int max, int 
initial);
 const char *qemu_ether_ntoa(const MACAddr *mac);
 
 #endif
+
+#define QEMU_DPRINTF(cond,pfx,fmt,...) \
+    do { \
+        if (cond) { \
+            fprintf(stderr, pfx": %s:"fmt, __func__, ## __VA_ARGS__); \
+        } \
+  } while (0)
-- 
1.7.10.4




reply via email to

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