From 69f49290fbc6c9c6eb694f8a14be1d85ce90ff2d Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Tue, 7 May 2024 20:53:41 -0700 Subject: [PATCH] Fixed compilation warning with Clang < 14 - closes #546 --- CHANGELOG.md | 1 + src/halfvec.h | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 775b888..3eae03e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Fixed `undefined symbol` error with GCC 8 - Fixed compilation error with universal binaries on Mac +- Fixed compilation warning with Clang < 14 ## 0.7.0 (2024-04-29) diff --git a/src/halfvec.h b/src/halfvec.h index f2cf145..778d6a7 100644 --- a/src/halfvec.h +++ b/src/halfvec.h @@ -19,9 +19,12 @@ #endif /* target_clones requires glibc */ -#if defined(USE_DISPATCH) && defined(__gnu_linux__) +#if defined(USE_DISPATCH) && defined(__gnu_linux__) && defined(__has_attribute) +/* Use separate line for portability */ +#if __has_attribute(target_clones) #define USE_TARGET_CLONES #endif +#endif /* Apple clang check needed for universal binaries on Mac */ #if defined(USE_DISPATCH) && (defined(HAVE__GET_CPUID) || defined(__apple_build_version__))