From ae176ffa19f972160b3b21536beca062f6ad0222 Mon Sep 17 00:00:00 2001 From: Guillaume Chatelet Date: Tue, 10 Sep 2024 11:52:10 +0200 Subject: [PATCH] Forward fix `cpu_features_macros.h` This is a fix for https://github.com/google/cpu_features/pull/363 . The preprocessor check must be done in two steps. --- include/cpu_features_macros.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/cpu_features_macros.h b/include/cpu_features_macros.h index 11502242..2d43b790 100644 --- a/include/cpu_features_macros.h +++ b/include/cpu_features_macros.h @@ -234,14 +234,15 @@ #endif // defined(CPU_FEATURES_ARCH_X86) +#if defined(CPU_FEATURES_ARCH_ANY_ARM) // Note: MSVC targeting ARM does not define `__ARM_NEON` but Windows on ARM // requires it. In that case we force NEON detection. -#if defined(__ARM_NEON) || \ - (defined(CPU_FEATURES_COMPILER_MSC) && defined(CPU_FEATURES_ARCH_ANY_ARM)) +#if defined(__ARM_NEON) || defined(CPU_FEATURES_COMPILER_MSC) #define CPU_FEATURES_COMPILED_ANY_ARM_NEON 1 #else #define CPU_FEATURES_COMPILED_ANY_ARM_NEON 0 -#endif +#endif // defined(__ARM_NEON) || defined(CPU_FEATURES_COMPILER_MSC) +#endif // defined(CPU_FEATURES_ARCH_ANY_ARM) #if defined(CPU_FEATURES_ARCH_MIPS) #if defined(__mips_msa)