diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2014-10-16 17:43:01 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2014-10-16 19:41:37 -0400 |
commit | 752f6a1103eaf0bf32a74caefd9e315548b39c77 (patch) | |
tree | 57f16ddeb131eb58e06c1e7b85a6679c0763a3e5 /src/include/intpack.i | |
parent | 185694d3494ce6817cd854feaff7169fb41dd13d (diff) | |
download | mongo-752f6a1103eaf0bf32a74caefd9e315548b39c77.tar.gz |
Windows Fixes
- Only test_compact.py, and test_backup03.py fail have the only unknown failures
Diffstat (limited to 'src/include/intpack.i')
-rw-r--r-- | src/include/intpack.i | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/include/intpack.i b/src/include/intpack.i index 41f742d6364..01559657acd 100644 --- a/src/include/intpack.i +++ b/src/include/intpack.i @@ -54,8 +54,14 @@ #define WT_LEADING_ZEROS(x, i) \ (i = (x == 0) ? (int)sizeof (x) : __builtin_clzll(x) >> 3) #elif defined(_MSC_VER) -#define WT_LEADING_ZEROS(x, i) \ - (i = (x == 0) ? (int)sizeof (x) : (int)__lzcnt64(x) >> 3) +#define WT_LEADING_ZEROS(x, i) do { \ + if (x == 0) i = (int)sizeof(x); \ + else { \ + unsigned long __index; \ + _BitScanReverse64(&__index, x); \ + __index = 63 ^ __index; \ + i = (int)(__index >> 3); } \ + } while (0) #else #define WT_LEADING_ZEROS(x, i) do { \ uint64_t __x = (x); \ |