dbg_log.h (474B)
1 void (*nissy_log)(const char *, ...); 2 3 #define LOG(...) if (nissy_log != NULL) nissy_log(__VA_ARGS__); 4 5 #ifdef DEBUG 6 #define STATIC 7 #define STATIC_INLINE 8 #define DBG_WARN(condition, ...) if (!(condition)) LOG(__VA_ARGS__); 9 #define DBG_ASSERT(condition, retval, ...) \ 10 if (!(condition)) { LOG(__VA_ARGS__); return retval; } 11 #else 12 #define STATIC static 13 #define STATIC_INLINE static inline 14 #define DBG_WARN(condition, ...) 15 #define DBG_ASSERT(condition, retval, ...) 16 #endif