From c100df4037b3ac11e6808663454d42c3d25d081d Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Fri, 27 Oct 2023 17:32:58 +1100 Subject: [PATCH] [all] common: debug assert should always abort --- common/include/common/debug.h | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/common/include/common/debug.h b/common/include/common/debug.h index 1dece5c1..1293266d 100644 --- a/common/include/common/debug.h +++ b/common/include/common/debug.h @@ -108,20 +108,13 @@ void printBacktrace(void); #define DEBUG_ASSERT_PRINT(...) DEBUG_ERROR("Assertion failed: %s", #__VA_ARGS__) -#ifdef NDEBUG - #define DEBUG_ASSERT(...) do { \ - if (!(__VA_ARGS__)) \ - DEBUG_ASSERT_PRINT(__VA_ARGS__); \ - } while (0) -#else - #define DEBUG_ASSERT(...) do { \ - if (!(__VA_ARGS__)) \ - { \ - DEBUG_ASSERT_PRINT(__VA_ARGS__); \ - abort(); \ - } \ - } while (0) -#endif +#define DEBUG_ASSERT(...) do { \ + if (!(__VA_ARGS__)) \ + { \ + DEBUG_ASSERT_PRINT(__VA_ARGS__); \ + abort(); \ + } \ +} while (0) #define DEBUG_UNREACHABLE() DEBUG_FATAL("Unreachable code reached")