liblzma: Tweak #if condition in memcmplen.h.

Maybe ICC always #defines _MSC_VER on Windows but now
it's very clear which code will get used.
This commit is contained in:
Lasse Collin 2023-07-18 13:57:54 +03:00
parent 40392c19f7
commit 97fd5cb669
1 changed files with 2 additions and 2 deletions

View File

@ -70,11 +70,11 @@ lzma_memcmplen(const uint8_t *buf1, const uint8_t *buf2,
const uint64_t x = read64ne(buf1 + len) - read64ne(buf2 + len); const uint64_t x = read64ne(buf1 + len) - read64ne(buf2 + len);
if (x != 0) { if (x != 0) {
// MSVC or Intel C compiler on Windows // MSVC or Intel C compiler on Windows
# if defined(_M_X64) && defined(_MSC_VER) # if (defined(_MSC_VER) || defined(__INTEL_COMPILER)) && defined(_M_X64)
unsigned long tmp; unsigned long tmp;
_BitScanForward64(&tmp, x); _BitScanForward64(&tmp, x);
len += (uint32_t)tmp >> 3; len += (uint32_t)tmp >> 3;
// GCC, clang, or Intel C compiler // GCC, Clang, or Intel C compiler
# else # else
len += (uint32_t)__builtin_ctzll(x) >> 3; len += (uint32_t)__builtin_ctzll(x) >> 3;
# endif # endif