aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-03-12 16:07:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-03-12 16:07:07 +0200
commit5956bce9b873b8cd481cb40cddef1bda882f5a3f (patch)
treeeae05187ee6f06f5c74f2784d8def38888a74ff3
parentf4cd7abdd38aa3d14dcce98cb92dc1054fe97503 (diff)
Disable use of _tzcnt_u64() in lz4.c for Clang targeting MSVC version 9
-rw-r--r--libbutl/lz4.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/libbutl/lz4.cxx b/libbutl/lz4.cxx
index a69c9ad..6a91a12 100644
--- a/libbutl/lz4.cxx
+++ b/libbutl/lz4.cxx
@@ -396,9 +396,12 @@ namespace butl
#define XXH_PRIVATE_API // Makes API static and includes xxhash.c.
#include "xxhash.h"
-// Clang 8 targeting MSVC does not have _tzcnt_u64().
+// Clang targeting MSVC prior to version 10 has difficulty with _tzcnt_u64()
+// (see Clang bug 47099 for a potentially related issue). Including relevant
+// headers (<immintrin.h>, <intrin.h>) does not appear to help. So for now we
+// just disable the use of _tzcnt_u64().
//
-#if defined(_MSC_VER) && defined(__clang__) && __clang_major__ <= 8
+#if defined(_MSC_VER) && defined(__clang__) && __clang_major__ < 10
# define LZ4_FORCE_SW_BITCOUNT
#endif