Skip to content

Commit

Permalink
handle 32bit size_t when building for x64
Browse files Browse the repository at this point in the history
  • Loading branch information
pps83 committed Jan 18, 2025
1 parent ee17f4c commit 2923208
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/common/bitstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ MEM_STATIC size_t BIT_initCStream(BIT_CStream_t* bitC,
FORCE_INLINE_TEMPLATE size_t BIT_getLowerBits(size_t bitContainer, U32 const nbBits)
{
#if defined(STATIC_BMI2) && STATIC_BMI2 == 1 && !defined(ZSTD_NO_INTRINSICS)
#if defined(__x86_64__) || defined(_M_X64)
return _bzhi_u64(bitContainer, nbBits);
#else
# if defined(__x86_64__) || defined(_M_X64)
return sizeof(size_t) == sizeof(U64) ? _bzhi_u64(bitContainer, nbBits) : _bzhi_u32(bitContainer, nbBits);
# else
return _bzhi_u32(bitContainer, nbBits);
#endif
# endif
#else
assert(nbBits < BIT_MASK_SIZE);
return bitContainer & BIT_mask[nbBits];
Expand Down

0 comments on commit 2923208

Please sign in to comment.