Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.
/ xz Public archive

Commit

Permalink
liblzma: Tweak #if condition in memcmplen.h.
Browse files Browse the repository at this point in the history
Maybe ICC always #defines _MSC_VER on Windows but now
it's very clear which code will get used.
  • Loading branch information
Larhzu committed Jul 18, 2023
1 parent 40392c1 commit 97fd5cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/liblzma/common/memcmplen.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ lzma_memcmplen(const uint8_t *buf1, const uint8_t *buf2,
const uint64_t x = read64ne(buf1 + len) - read64ne(buf2 + len);
if (x != 0) {
// 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;
_BitScanForward64(&tmp, x);
len += (uint32_t)tmp >> 3;
// GCC, clang, or Intel C compiler
// GCC, Clang, or Intel C compiler
# else
len += (uint32_t)__builtin_ctzll(x) >> 3;
# endif
Expand Down

0 comments on commit 97fd5cb

Please sign in to comment.