From 1ccb7ea88b0e11bc6c016d0bf5954f454671ce38 Mon Sep 17 00:00:00 2001 From: Pavel P Date: Sun, 11 Dec 2022 21:51:06 +0300 Subject: [PATCH] Do not redefine _mm_cvtsi64_si128 when building with clang-cl Fixes the following warnings/errors when building for x86 with clang: ``` 1>../..\bitunpack.c(160,23): error : redefinition of '_mm_cvtsi64_si128' 1>C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\Llvm\lib\clang\15.0.1\include\emmintrin.h(3298,46): message : previous definition is here ``` --- bitunpack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitunpack.c b/bitunpack.c index e722b1e..1dd7800 100644 --- a/bitunpack.c +++ b/bitunpack.c @@ -156,7 +156,7 @@ size_t bitnfunpack64( unsigned char *__restrict in, size_t n, uint64_t *__restri #define mm256_maskz_expand_epi32(_m_,_v_) _mm256_maskz_expand_epi32(_m_,_v_) #define mm256_maskz_loadu_epi32( _m_,_v_) _mm256_maskz_loadu_epi32( _m_,_v_) #else -#if !(defined(_M_X64) || defined(__amd64__)) && (defined(__i386__) || defined(_M_IX86)) +#if !(defined(_M_X64) || defined(__amd64__)) && (defined(__i386__) || defined(_M_IX86)) && !defined(__clang__) static inline __m128i _mm_cvtsi64_si128(__int64 a) { return _mm_loadl_epi64((__m128i*)&a); } #endif static ALIGNED(unsigned char, permv[256][8], 32) = {