Use 64 bit bsr

I am determined to get this to work!
This commit is contained in:
Jurjen N. E. Bos 2020-12-18 17:58:24 +01:00 committed by GitHub
parent c0fc493e6e
commit 5ba4194586
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -186,9 +186,12 @@ _Py_bit_length_size_t(size_t x)
}
#elif defined(_MSC_VER)
// _BitScanReverse() is documented to search 32 bits.
Py_BUILD_ASSERT(sizeof(size_t) <= 4);
unsigned long msb;
size_t msb;
#if SIZEOF_SIZE_T == 8
if (_BitScanReverse64(&msb, x)) {
#else
if (_BitScanReverse(&msb, x)) {
#endif
return (int)msb + 1;
}
else {