diff options
Diffstat (limited to '')
| -rw-r--r-- | src/utils/constants.h (renamed from src/constants.h) | 0 | ||||
| -rw-r--r-- | src/utils/dbg_log.h | 16 | ||||
| -rw-r--r-- | src/utils/math.h (renamed from src/utils.h) | 0 | ||||
| -rw-r--r-- | src/utils/utils.h | 3 |
4 files changed, 19 insertions, 0 deletions
diff --git a/src/constants.h b/src/utils/constants.h index 52e2810..52e2810 100644 --- a/src/constants.h +++ b/src/utils/constants.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 @@ | |||
| 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 | ||
diff --git a/src/utils.h b/src/utils/math.h index 87402e6..87402e6 100644 --- a/src/utils.h +++ b/src/utils/math.h | |||
diff --git a/src/utils/utils.h b/src/utils/utils.h new file mode 100644 index 0000000..ce4355e --- /dev/null +++ b/src/utils/utils.h | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | #include "dbg_log.h" | ||
| 2 | #include "constants.h" | ||
| 3 | #include "math.h" | ||
