mirror of
https://github.com/espressif/openthread.git
synced 2026-08-03 09:27:47 +00:00
[debug] check NDEBUG for OT_ASSERT (#11929)
This commit verifies NDEBUG is not defined when OT_ASSERT is enabled and is delegated to assert().
This commit is contained in:
@@ -69,6 +69,11 @@
|
||||
|
||||
#elif defined(__APPLE__) || defined(__linux__)
|
||||
|
||||
#ifdef NDEBUG
|
||||
#error \
|
||||
"OPENTHREAD_CONFIG_PLATFORM_ASSERT_MANAGEMENT is not defined, OT_ASSERT requires assert() to work, but NDEBUG is defined!"
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#define OT_ASSERT(cond) assert(cond)
|
||||
|
||||
@@ -335,7 +335,11 @@
|
||||
* Define as 1 to enable assert function `OT_ASSERT()` within OpenThread code and its libraries.
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_ASSERT_ENABLE
|
||||
#ifndef NDEBUG
|
||||
#define OPENTHREAD_CONFIG_ASSERT_ENABLE 1
|
||||
#else
|
||||
#define OPENTHREAD_CONFIG_ASSERT_ENABLE 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user