pgvector.git / summary / log / commit / refs
commit 69f49290fbc6c9c6eb694f8a14be1d85ce90ff2d
Author: Andrew Kane <andrew@ankane.org>
Date: Wed May 08 03:53:41 2024 +0000
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 775b8883..3eae03e2 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 f2cf1457..778d6a7d 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__))
[parent: ad9145126638]