From 5159b9cb910d76128f68cd4ee36a9c13bac17730 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 12 Mar 2021 11:58:22 +0200 Subject: Fixes --- libbutl/lz4.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'libbutl') 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 +// 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 -- cgit v1.1