summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2020-11-14 14:26:08 -0800
committerYann Collet <cyan@fb.com>2020-11-14 14:26:08 -0800
commit581c459b4ec4bbaae518a0ef9baa552f21f9e24e (patch)
treec82d439435c0f393d595cba4816e4ab0e1708fd7
parent80751571ae235869dc5b91a5f7f8ec8d6a119ee0 (diff)
downloadlz4-581c459b4ec4bbaae518a0ef9baa552f21f9e24e.tar.gz
lz4-581c459b4ec4bbaae518a0ef9baa552f21f9e24e.tar.bz2
lz4-581c459b4ec4bbaae518a0ef9baa552f21f9e24e.zip
restrict BitScanForward() to VS2005+
suggested by @aqrit in #947
-rw-r--r--lib/lz4.c2
1 files changed, 1 insertions, 1 deletions
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;