Skip to content

Commit

Permalink
Actually turn asserts off in debug build
Browse files Browse the repository at this point in the history
Can't believe this has been like this for this long.
  • Loading branch information
Ivan-Velickovic committed Feb 21, 2024
1 parent 24e1837 commit 84337f9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/util/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,18 @@ static void assert_fail(
while (1) {}
}

#ifndef CONFIG_DEBUG_BUILD

#define _unused(x) ((void)(x))
#define assert(expr) _unused(expr)

#else

#define assert(expr) \
do { \
if (!(expr)) { \
assert_fail(#expr, __FILE__, __LINE__, __FUNCTION__); \
} \
} while(0)

#endif

0 comments on commit 84337f9

Please sign in to comment.