aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-03-12 11:58:22 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-03-12 11:58:22 +0200
commit5159b9cb910d76128f68cd4ee36a9c13bac17730 (patch)
tree5238ff7acd16fa9087336a7f0e5e82c25d7c66f5
parent3efc32d82de64216410936b746d11ab4aaf561ec (diff)
Fixes
-rw-r--r--libbutl/lz4.cxx13
-rw-r--r--tests/lz4/buildfile2
2 files changed, 8 insertions, 7 deletions
diff --git a/libbutl/lz4.cxx b/libbutl/lz4.cxx
index 54a1d82..9b0e103 100644
--- a/libbutl/lz4.cxx
+++ b/libbutl/lz4.cxx
@@ -3,6 +3,12 @@
#include <libbutl/lz4.hxx>
+// Clang 8 targeting MSVC does not have _tzcnt_u64().
+//
+#if defined(_MSC_VER) && defined(__clang__) && __clang_major__ <= 8
+# define LZ4_FORCE_SW_BITCOUNT
+#endif
+
// This careful macro dance makes sure that all the LZ4 C API functions are
// made static while making sure we include the headers in the same way as the
// implementation files that we include below.
@@ -386,8 +392,7 @@ namespace butl
// Include the implementation into our translation unit. Let's keep it last
// since the implementation defines a bunch of macros.
//
-#if defined(__clang__) || defined (__GNUC__)
-# pragma GCC diagnostic push
+#if defined(__clang__) || defined(__GNUC__)
# pragma GCC diagnostic ignored "-Wunused-function"
#endif
@@ -405,7 +410,3 @@ extern "C"
#include "lz4hc.c"
#include "lz4frame.c"
}
-
-#if defined(__clang__) || defined (__GNUC__)
-# pragma GCC diagnostic pop
-#endif
diff --git a/tests/lz4/buildfile b/tests/lz4/buildfile
index 8944dba..1f9a244 100644
--- a/tests/lz4/buildfile
+++ b/tests/lz4/buildfile
@@ -3,4 +3,4 @@
import libs = libbutl%lib{butl}
-exe{driver}: {hxx cxx}{*} $libs testscript
+exe{driver}: {hxx cxx}{*} $libs testscript file{*.lz4}