qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 07/31] kqemu.c: LOG_INT macro


From: Eduardo Habkost
Subject: [Qemu-devel] [PATCH 07/31] kqemu.c: LOG_INT macro
Date: Fri, 12 Dec 2008 13:08:46 -0200

This macro will avoid some #ifdefs in the code and create a single point
where the logging call can be changed in the future.

Signed-off-by: Eduardo Habkost <address@hidden>
---
 kqemu.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/kqemu.c b/kqemu.c
index 4783aa2..ec5f378 100644
--- a/kqemu.c
+++ b/kqemu.c
@@ -47,6 +47,16 @@
 #define DEBUG
 //#define PROFILE
 
+
+#ifdef DEBUG
+#  define LOG_INT(...) do {              \
+     if (loglevel & CPU_LOG_INT)         \
+       fprintf(logfile, ## __VA_ARGS__); \
+   } while (0)
+#else
+#  define LOG_INT(...) do { } while (0)
+#endif
+
 #include <unistd.h>
 #include <fcntl.h>
 #include "kqemu.h"
-- 
1.5.5.GIT





reply via email to

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