This is an automated email from the ASF dual-hosted git repository.
janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
The following commit(s) were added to refs/heads/master by this push:
new 5f3bf9aeb Fix build error with arm gcc 12.3.1
5f3bf9aeb is described below
commit 5f3bf9aeb01c9ff4197da6929cfca6484855c398
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Fri Aug 18 22:35:24 2023 +0200
Fix build error with arm gcc 12.3.1
While trying to build with arm-none-eabi-gcc version 12.3.1
and setting LIBC: nano, the compiler did not recognise static_assert.
---
hw/mcu/nordic/include/nrfx_glue.h | 2 +-
libc/baselibc/include/assert.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/mcu/nordic/include/nrfx_glue.h
b/hw/mcu/nordic/include/nrfx_glue.h
index 475b174c3..30cbed437 100644
--- a/hw/mcu/nordic/include/nrfx_glue.h
+++ b/hw/mcu/nordic/include/nrfx_glue.h
@@ -67,7 +67,7 @@ extern "C" {
*
* @param expression Expression to evaluate.
*/
-#define NRFX_STATIC_ASSERT(expression) static_assert(expression, "")
+#define NRFX_STATIC_ASSERT(expression) _Static_assert(expression, "")
//------------------------------------------------------------------------------
diff --git a/libc/baselibc/include/assert.h b/libc/baselibc/include/assert.h
index 9a9646678..73ba1b01f 100644
--- a/libc/baselibc/include/assert.h
+++ b/libc/baselibc/include/assert.h
@@ -29,6 +29,8 @@ extern "C" {
#if !defined __cplusplus
#define static_assert _Static_assert
+#elif !defined _Static_assert
+#define _Static_assert static_assert
#endif
#ifdef __cplusplus