[all] common: debug assert should always abort

This commit is contained in:
Geoffrey McRae 2023-10-27 17:32:58 +11:00
parent 47329ebd89
commit c100df4037

View File

@ -108,12 +108,6 @@ void printBacktrace(void);
#define DEBUG_ASSERT_PRINT(...) DEBUG_ERROR("Assertion failed: %s", #__VA_ARGS__) #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 { \ #define DEBUG_ASSERT(...) do { \
if (!(__VA_ARGS__)) \ if (!(__VA_ARGS__)) \
{ \ { \
@ -121,7 +115,6 @@ void printBacktrace(void);
abort(); \ abort(); \
} \ } \
} while (0) } while (0)
#endif
#define DEBUG_UNREACHABLE() DEBUG_FATAL("Unreachable code reached") #define DEBUG_UNREACHABLE() DEBUG_FATAL("Unreachable code reached")