aboutsummaryrefslogtreecommitdiff
path: root/src/utils/dbg_log.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-08-18 14:26:45 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-08-18 14:26:45 +0200
commit18c9a8b8905304cf5f8fc15825769046a3144866 (patch)
treea7807bb32b0a5d9ded7d3cedccc598f64a9b00fe /src/utils/dbg_log.h
parentf25a10e19eca294c4e6a99e4f80ce5cfd11a0e5f (diff)
downloadnissy-core-18c9a8b8905304cf5f8fc15825769046a3144866.tar.gz
nissy-core-18c9a8b8905304cf5f8fc15825769046a3144866.zip
Reorganized folder structure
Diffstat (limited to 'src/utils/dbg_log.h')
-rw-r--r--src/utils/dbg_log.h16
1 files changed, 16 insertions, 0 deletions
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 @@
1void (*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

Generated with cgit - Back to sebastiano.tronto.net