[Spice-devel] [PATHCH win-qxl 4/8] display/qxldd.h: add DEBUG_PRINT_ONCE

Alon Levy alevy at redhat.com
Thu Apr 7 09:10:41 PDT 2011


---
 display/qxldd.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/display/qxldd.h b/display/qxldd.h
index 0f90af1..7130b47 100644
--- a/display/qxldd.h
+++ b/display/qxldd.h
@@ -44,6 +44,15 @@
 
 #define DEBUG_PRINT(arg) DebugPrint arg
 
+#define DEBUG_PRINT_ONCE(arg)       \
+    {                               \
+        static int run = 0;         \
+        if (!run) {                 \
+            run = 1;                \
+            DebugPrint arg;         \
+        }                           \
+    }
+
 #ifdef DBG
 #define ASSERT(pdev, x) if (!(x)) { \
     DebugPrint(pdev, 0, "ASSERT(%s) failed @ %s\n", #x, __FUNCTION__); \
-- 
1.7.4.2



More information about the Spice-devel mailing list