From b831714cf5e4eda5bc199d4c73276d9d6e1a2211 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Thu, 11 Apr 2019 11:57:42 +0200 Subject: [PATCH] Add missing patch --- assert.patch | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 assert.patch diff --git a/assert.patch b/assert.patch new file mode 100644 index 0000000..b89d07a --- /dev/null +++ b/assert.patch @@ -0,0 +1,43 @@ +Submodule subprojects/c-stdaux 1bcec74..11930d2: +diff --git a/subprojects/c-stdaux/src/c-stdaux.h b/subprojects/c-stdaux/src/c-stdaux.h +index d305780..a02aed9 100644 +--- a/subprojects/c-stdaux/src/c-stdaux.h ++++ b/subprojects/c-stdaux/src/c-stdaux.h +@@ -437,9 +437,10 @@ _Static_assert(_assertion, _message); \ + * macro is used with constant expressions, the compiler will be able to + * optimize it away. + */ +-static inline void c_assert(bool expr_result) { +- assert(expr_result); +-} ++#define c_assert(_x) ({ \ ++ const _c_unused_ bool c_assert_result = (_x); \ ++ assert(c_assert_result && #_x); \ ++ }) + + /** + * c_errno() - return valid errno +diff --git a/subprojects/c-stdaux/src/test-api.c b/subprojects/c-stdaux/src/test-api.c +index 31d4d54..fb50066 100644 +--- a/subprojects/c-stdaux/src/test-api.c ++++ b/subprojects/c-stdaux/src/test-api.c +@@ -170,6 +170,11 @@ static void test_api_macros(void) { + c_assert(c_align_to(0, 0) == 0); + } + ++ /* c_assert */ ++ { ++ c_assert(true); ++ } ++ + /* C_DEFINE_CLEANUP / C_DEFINE_DIRECT_CLEANUP */ + { + int v = 0; +@@ -181,7 +186,6 @@ static void test_api_macros(void) { + + static void test_api_functions(void) { + void *fns[] = { +- (void *)c_assert, + (void *)c_errno, + (void *)c_free, + (void *)c_close,