blob: f9b1d8a8bebc2d4817cfa81ef3b636debf0a78fb (
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
|