From 58c6022ebc22e88397f4ac85788b02dafa679b7d Mon Sep 17 00:00:00 2001 From: Uneven Prankster Date: Sat, 12 Aug 2023 13:32:39 -0300 Subject: Replaced checks with trap asserts, it's 2023, you can use gdb, we have technology --- src/config.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/config.h') 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 -- cgit v1.2.3