Browse Source

util: Add debug_printf_once

tags/mesa_7_5_rc1
Micah Dowty 16 years ago
parent
commit
b618827fac
1 changed files with 16 additions and 0 deletions
  1. 16
    0
      src/gallium/auxiliary/util/u_debug.h

+ 16
- 0
src/gallium/auxiliary/util/u_debug.h View File

@@ -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

Loading…
Cancel
Save