From 18c9a8b8905304cf5f8fc15825769046a3144866 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sun, 18 Aug 2024 14:26:45 +0200 Subject: Reorganized folder structure --- src/utils/dbg_log.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/utils/dbg_log.h (limited to 'src/utils/dbg_log.h') diff --git a/src/utils/dbg_log.h b/src/utils/dbg_log.h new file mode 100644 index 0000000..427eceb --- /dev/null +++ b/src/utils/dbg_log.h @@ -0,0 +1,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 -- cgit v1.3