mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-12 20:27:53 +00:00
[all] common: debug assert should always abort
This commit is contained in:
parent
47329ebd89
commit
c100df4037
1 changed files with 7 additions and 14 deletions
|
@ -108,20 +108,13 @@ 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 { \
|
||||||
#define DEBUG_ASSERT(...) do { \
|
if (!(__VA_ARGS__)) \
|
||||||
if (!(__VA_ARGS__)) \
|
{ \
|
||||||
DEBUG_ASSERT_PRINT(__VA_ARGS__); \
|
DEBUG_ASSERT_PRINT(__VA_ARGS__); \
|
||||||
} while (0)
|
abort(); \
|
||||||
#else
|
} \
|
||||||
#define DEBUG_ASSERT(...) do { \
|
} while (0)
|
||||||
if (!(__VA_ARGS__)) \
|
|
||||||
{ \
|
|
||||||
DEBUG_ASSERT_PRINT(__VA_ARGS__); \
|
|
||||||
abort(); \
|
|
||||||
} \
|
|
||||||
} while (0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define DEBUG_UNREACHABLE() DEBUG_FATAL("Unreachable code reached")
|
#define DEBUG_UNREACHABLE() DEBUG_FATAL("Unreachable code reached")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue