aboutsummaryrefslogtreecommitdiff
path: root/src/utils/dbg_log.h
blob: 427eceb3da483eb3d529638349e41628d8428357 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
void (*nissy_log)(const char *, ...);

#define LOG(...) if (nissy_log != NULL) nissy_log(__VA_ARGS__);

#ifdef DEBUG
#define _static
#define _static_inline
#define DBG_WARN(condition, ...) if (!(condition)) LOG(__VA_ARGS__);
#define DBG_ASSERT(condition, retval, ...) \
    if (!(condition)) { LOG(__VA_ARGS__); return retval; }
#else
#define _static static
#define _static_inline static inline
#define DBG_WARN(condition, ...)
#define DBG_ASSERT(condition, retval, ...)
#endif

Generated with cgit - Back to sebastiano.tronto.net