We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This function
base/src/int_math_stubs.c
Line 25 in aee79da
is not supported by 32-bit MSVC (see https://docs.microsoft.com/en-us/cpp/intrinsics/bitscanforward-bitscanforward64). So I get a link error.
The text was updated successfully, but these errors were encountered:
The following patch should fix the bug:
--- a/src/int_math_stubs.c 2019-02-25 13:55:12.000000000 +0300 +++ b/src/int_math_stubs.c 2019-04-04 18:29:43.760643700 +0300 @@ -12,17 +12,24 @@ #define __builtin_popcountll __popcnt64 #define __builtin_popcount __popcnt -static uint32_t __inline __builtin_clz(uint32_t x) +static int __inline __builtin_clz(uint32_t x) { int r = 0; _BitScanForward(&r, x); return r; } -static uint64_t __inline __builtin_clzll(uint64_t x) +static int __inline __builtin_clzll(uint64_t x) { int r = 0; +#ifdef _WIN64 _BitScanForward64(&r, x); +#else + if (!_BitScanForward(&r, (uint32_t)x) && + _BitScanForward(&r, (uint32_t)(x>>32))) { + r += 32; + } +#endif return r; }
Sorry, something went wrong.
No branches or pull requests
This function
base/src/int_math_stubs.c
Line 25 in aee79da
is not supported by 32-bit MSVC (see https://docs.microsoft.com/en-us/cpp/intrinsics/bitscanforward-bitscanforward64). So I get a link error.
The text was updated successfully, but these errors were encountered: