summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoronelin <oscar@nelin.dk>2025-11-30 00:24:13 +0000
committeronelin <oscar@nelin.dk>2025-12-18 21:14:17 +0000
commit00726871fa0861a4eb8ed57110c61763e1076b91 (patch)
tree7aca1eef1162ea52bcaf57ef8a623a0ddc81df18
parent4039166875da65715e8c49d334638dc9dd1d5f7b (diff)
Split UNIMPLEMENTED implementation dependent on build type
-rw-r--r--src/include/daw/logging.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/include/daw/logging.h b/src/include/daw/logging.h
index 59342fe..ec4674e 100644
--- a/src/include/daw/logging.h
+++ b/src/include/daw/logging.h
@@ -5,11 +5,8 @@
extern "C" {
#endif
-#include <math.h>
#include <stdarg.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <daw/types.h>
@@ -48,14 +45,15 @@ void ERROR(const char* fmt, ...);
void __DEBUG(const char* file, const i32 line, const char* func,
const char* fmt, ...);
-#define ASSERT(cond) if (!(cond)) { ERROR("ASSERTION FAILED! " #cond); __asm__("int3;"); }
+#define UNIMPLEMENTED { DEBUG("%s is not implemented yet!", __func__); __asm__("int3;"); } do {} while (false)
+
+#define ASSERT(cond) if (!(cond)) { ERROR("ASSERTION FAILED! " #cond); __asm__("int3;"); } do {} while (false)
#else
#define DEBUG(...)
#define ASSERT(...)
+#define UNIMPLEMENTED { DEBUG("%s is not implemented yet!", __func__); exit(EXIT_FAILURE); } do {} while (false)
#endif
-#define UNIMPLEMENTED DEBUG("%s is not implemented yet!", __func__); exit(EXIT_FAILURE)
-
#ifdef __cplusplus
}
#endif