mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-10 20:54:24 +00:00
lwip: Support silent assertion configuration
If silent assert configuration is enabled, LWIP asserts are now 'silent' also. Also updates KConfig to note that LWIP asserts are also disabled when asserts are disabled globally (this was already the behaviour, but the config item suggested otherwise.) Progress towards https://github.com/espressif/esp-idf/issues/5873
This commit is contained in:
@@ -75,13 +75,20 @@ typedef int sys_prot_t;
|
||||
#include <stdio.h>
|
||||
|
||||
#define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0)
|
||||
// __assert_func is the assertion failure handler from newlib, defined in assert.h
|
||||
#define LWIP_PLATFORM_ASSERT(message) __assert_func(__FILE__, __LINE__, __ASSERT_FUNC, message)
|
||||
|
||||
#ifdef NDEBUG
|
||||
#define LWIP_NOASSERT
|
||||
|
||||
#define LWIP_NOASSERT 1
|
||||
|
||||
#else // Assertions enabled
|
||||
|
||||
#if CONFIG_OPTIMIZATION_ASSERTIONS_SILENT
|
||||
#define LWIP_PLATFORM_ASSERT(message) abort()
|
||||
#else
|
||||
// __assert_func is the assertion failure handler from newlib, defined in assert.h
|
||||
#define LWIP_PLATFORM_ASSERT(message) __assert_func(__FILE__, __LINE__, __ASSERT_FUNC, message)
|
||||
#endif
|
||||
|
||||
// If assertions are on, the default LWIP_ERROR handler behaviour is to
|
||||
// abort w/ an assertion failure. Don't do this, instead just print the error (if LWIP_DEBUG is set)
|
||||
// and run the handler (same as the LWIP_ERROR behaviour if LWIP_NOASSERT is set).
|
||||
|
Reference in New Issue
Block a user