projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
99b77d0
)
util: Add debug_printf_once
author
Micah Dowty
<micah@vmware.com>
Fri, 24 Apr 2009 21:45:16 +0000
(23:45 +0200)
committer
Jakob Bornecrantz
<jakob@vmware.com>
Fri, 24 Apr 2009 21:59:21 +0000
(23:59 +0200)
src/gallium/auxiliary/util/u_debug.h
patch
|
blob
|
history
diff --git
a/src/gallium/auxiliary/util/u_debug.h
b/src/gallium/auxiliary/util/u_debug.h
index bcd8f0f3cf1dee02776b89b6f967a0c5deeeb940..d42b65ce28107cef384c13b89c9b8033d29acaaa 100644
(file)
--- a/
src/gallium/auxiliary/util/u_debug.h
+++ b/
src/gallium/auxiliary/util/u_debug.h
@@
-102,6
+102,22
@@
debug_printf(const char *format, ...)
}
+/*
+ * ... isn't portable so we need to pass arguments in parentheses.
+ *
+ * usage:
+ * debug_printf_once(("awnser: %i\n", 42));
+ */
+#define debug_printf_once(args) \
+ do { \
+ static boolean once = TRUE; \
+ if (once) { \
+ once = FALSE; \
+ debug_printf args; \
+ } \
+ } while (0)
+
+
#ifdef DEBUG
#define debug_vprintf(_format, _ap) _debug_vprintf(_format, _ap)
#else