From 84337f933d4bb54dbe2b8813d7463f32437b7aaa Mon Sep 17 00:00:00 2001 From: Ivan Velickovic Date: Wed, 21 Feb 2024 15:59:42 +1100 Subject: [PATCH] Actually turn asserts off in debug build Can't believe this has been like this for this long. --- src/util/util.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/util/util.h b/src/util/util.h index f473b73e..b326ac0b 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -58,6 +58,13 @@ 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)) { \ @@ -65,3 +72,4 @@ static void assert_fail( } \ } while(0) +#endif