From 581c459b4ec4bbaae518a0ef9baa552f21f9e24e Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Sat, 14 Nov 2020 14:26:08 -0800 Subject: [PATCH] restrict BitScanForward() to VS2005+ suggested by @aqrit in #947 --- lib/lz4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lz4.c b/lib/lz4.c index 5fe3433..5c6cf4d 100644 --- a/lib/lz4.c +++ b/lib/lz4.c @@ -533,7 +533,7 @@ static unsigned LZ4_NbCommonBytes (reg_t val) return (unsigned)(((U64)((val & (m - 1)) * m)) >> 56); # endif } else /* 32 bits */ { -# if defined(_MSC_VER) && !defined(LZ4_FORCE_SW_BITCOUNT) +# if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(LZ4_FORCE_SW_BITCOUNT) unsigned long r; _BitScanForward(&r, (U32)val); return (unsigned)r >> 3; -- 2.7.4