aboutsummaryrefslogtreecommitdiff
path: root/src/config.h
diff options
context:
space:
mode:
authorUneven Prankster <unevenprankster@protonmail.com>2023-08-12 13:32:39 -0300
committerUneven Prankster <unevenprankster@protonmail.com>2023-08-12 13:32:39 -0300
commit58c6022ebc22e88397f4ac85788b02dafa679b7d (patch)
treef5069cb935b79ef71c04d0bec7742c28fcbed3b2 /src/config.h
parente7379bed59af0f50126af61953bc4f10af04a4dd (diff)
Replaced checks with trap asserts, it's 2023, you can use gdb, we have technology
Diffstat (limited to 'src/config.h')
-rw-r--r--src/config.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/config.h b/src/config.h
index 18dc414..019ceaf 100644
--- a/src/config.h
+++ b/src/config.h
@@ -38,4 +38,16 @@ typedef struct{
typedef i32 b32;
#define false 0
-#define true 1 \ No newline at end of file
+#define true 1
+
+#ifdef DEBUG
+# if __GNUC__
+# define assert(c) if (!(c)) __builtin_trap()
+# elif _MSC_VER
+# define assert(c) if (!(c)) __debugbreak()
+# else
+# define assert(c) if (!(c)) *(volatile int *)0 = 0
+# endif
+#else
+# define assert(c)
+#endif \ No newline at end of file