You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge #72: Fix MSVC implementation of CountBits() function
0078bed Ignore `HAVE_CLZ` macro when building with MSVC (Hennadii Stepanov)
1c77291 Fix MSVC implementation of `CountBits()` function (Hennadii Stepanov)
Pull request description:
The current MSVC-specific implementation of the `CountBits()` function, which uses `_BitScanReverse` and `_BitScanReverse64` intrinsic functions, returns the wrong value with offset 1.
See: https://learn.microsoft.com/en-us/cpp/intrinsics/bitscanreverse-bitscanreverse64?view=msvc-170
The second commit makes MSVC ignore a possible `/DHAVE_CLZ` option (as this compiler is not handled by the current build system), which otherwise causes a compiling error.
A branch, which allows to test this PR easily, is [here](https://github.com/hebasto/minisketch/commits/221018-bits.test).
Fixes#67.
ACKs for top commit:
sipa:
ACK 0078bed
Tree-SHA512: 7c4ae68acd11be8a0729c5d5e231fe5da0302ca4543bb5734c8a96d65e190b35155d14945e6afca211270a8d235293d74391bc74ea4a6ee756084aa0b834d87b
0 commit comments