From 92e518ed5cc15bed63f23459d81c51cfb2f7b970 Mon Sep 17 00:00:00 2001 From: Thad House Date: Tue, 13 Sep 2022 17:03:55 -0700 Subject: [PATCH] rpi_pico: add support for Pi Pico and C11 Currently if C11 or higher is enabled, many files fail to compile because static_assert is defined in multiple header files. Solve this by disabling the one in the HAL if the other macro is found Signed-off-by: Thad House --- modules/hal_rpi_pico/pico/config_autogen.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/hal_rpi_pico/pico/config_autogen.h b/modules/hal_rpi_pico/pico/config_autogen.h index 39c436f9539..e8fe4d17579 100644 --- a/modules/hal_rpi_pico/pico/config_autogen.h +++ b/modules/hal_rpi_pico/pico/config_autogen.h @@ -22,7 +22,9 @@ * BUILD_ASSERT is included through toolchain.h. */ #include +#if !defined(__cplusplus) && !defined(static_assert) #define static_assert(expr, msg...) BUILD_ASSERT((expr), "" msg) +#endif /* static_assert && __cplusplus__ */ /* Convert uses of asm, which is not supported in c99, to __asm */ #define asm __asm