blob: 5c93f4caee2246a861362c3d2c563990b6a64110 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#ifndef GUARD_UTIL_H
#define GUARD_UTIL_H
#include <cstdio>
#include <cstdarg>
static inline __attribute__((format(printf, 1, 2))) void debug_printf(const char * fmt, ...) {
#ifndef NDEBUG
fputs("DEBUG: ", stderr);
va_list va_args;
va_start(va_args, fmt);
vfprintf(stderr, fmt, va_args);
va_end(va_args);
#endif //NDEBUG
}
#endif //GUARD_UTIL_H
|