From a5f34cd26f251ef7e9486e69b2177ca040a774ce Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Tue, 11 Apr 2023 11:35:55 +0200 Subject: [PATCH] mcux: use Zephyr BIT() if building for Zephyr BIT() definition in a public header conflicts with Zephyr's own definition. Even though it is guarded with an ifndef, in some occasions we can't control the order of includes, leading to build errors. Signed-off-by: Gerard Marull-Paretas --- mcux/mcux-sdk/CMSIS/Core_A/Include/core_ca53.h | 4 +++- mcux/mcux-sdk/CMSIS/Core_A/Include/core_ca55.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mcux/mcux-sdk/CMSIS/Core_A/Include/core_ca53.h b/mcux/mcux-sdk/CMSIS/Core_A/Include/core_ca53.h index 2c8a5bc66..b837abdd2 100644 --- a/mcux/mcux-sdk/CMSIS/Core_A/Include/core_ca53.h +++ b/mcux/mcux-sdk/CMSIS/Core_A/Include/core_ca53.h @@ -95,8 +95,10 @@ * Register Definitions ******************************************************************************/ -#ifndef BIT +#if !defined(BIT) && !defined(__ZEPHYR__) #define BIT(n) (1 << (n)) +#else +#include #endif /* DAIF Register */ diff --git a/mcux/mcux-sdk/CMSIS/Core_A/Include/core_ca55.h b/mcux/mcux-sdk/CMSIS/Core_A/Include/core_ca55.h index d796e2729..5a81df0ec 100644 --- a/mcux/mcux-sdk/CMSIS/Core_A/Include/core_ca55.h +++ b/mcux/mcux-sdk/CMSIS/Core_A/Include/core_ca55.h @@ -95,8 +95,10 @@ * Register Definitions ******************************************************************************/ -#ifndef BIT +#if !defined(BIT) && !defined(__ZEPHYR__) #define BIT(n) (1 << (n)) +#else +#include #endif /* DAIF Register */