util: Add debug_printf_once

This commit is contained in:
Micah Dowty 2009-04-24 23:45:16 +02:00 committed by Jakob Bornecrantz
parent 99b77d05d2
commit b618827fac

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