From 1b76253e0ef924268f056dc401c9cd1b64141d2f Mon Sep 17 00:00:00 2001 From: Felipe Neves Date: Fri, 25 Oct 2019 11:24:12 -0300 Subject: [PATCH] newlib/assert: placed unlikely macro as part of assertion newlib/assert: replace unlikely with likely to keep original assertion newlib/assert: fix assert macro that uses likely freertos/port: add the missing sdkconfig.h back newlib/assert: assert macro back to a single line --- components/freertos/port.c | 1 - components/newlib/platform_include/assert.h | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/freertos/port.c b/components/freertos/port.c index 74879e3d5c..9bbff3236e 100644 --- a/components/freertos/port.c +++ b/components/freertos/port.c @@ -90,7 +90,6 @@ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- */ - #include #include #include diff --git a/components/newlib/platform_include/assert.h b/components/newlib/platform_include/assert.h index 3568727212..d800985b2a 100644 --- a/components/newlib/platform_include/assert.h +++ b/components/newlib/platform_include/assert.h @@ -19,10 +19,12 @@ #pragma once #include #include +#include "esp_compiler.h" #include_next + #if defined(CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT) && !defined(NDEBUG) #undef assert -#define assert(__e) ((__e) ? (void)0 : abort()) +#define assert(__e) (likely(__e)) ? (void)0 : abort() #endif