From 8bdec2b4db0c087e1ca9310b523c1bb82d67fe2a Mon Sep 17 00:00:00 2001 From: Martin Kojtal Date: Mon, 12 Jul 2021 14:25:21 +0100 Subject: [PATCH] retarget: move compat header for ARMClang prior any cmsis headers Reference: CMSIS 5.8.0 known issues and https://github.com/ARM-software/CMSIS_5/issues/1211 This fixes the error about redefinition of enable/disable irq. we need compat header because of semihosting (not yet provided in CMSIS). --- platform/source/mbed_retarget.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platform/source/mbed_retarget.cpp b/platform/source/mbed_retarget.cpp index 28201757a2..cf6dd3c0b7 100644 --- a/platform/source/mbed_retarget.cpp +++ b/platform/source/mbed_retarget.cpp @@ -15,6 +15,11 @@ * limitations under the License. */ +// Workaround for CMSIS 5.8.0, compat header must be placed before any CMSIS header inclusion +#if defined(__ARMCC_VERSION) +# include +#endif + #include #include #include "platform/platform.h" @@ -53,7 +58,6 @@ struct DIR_impl { }; #if defined(__ARMCC_VERSION) -# include # include # include # include