Fix Windows 2016 build. (#5902)

This commit is contained in:
Jiaming Yuan 2020-07-18 05:50:17 +08:00 committed by GitHub
parent 71b0528a2f
commit 6c0c87216f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 8 deletions

View File

@ -80,7 +80,7 @@ if __name__ == "__main__":
with cd("build"): with cd("build"):
if sys.platform == "win32": if sys.platform == "win32":
# Force x64 build on Windows. # Force x64 build on Windows.
maybe_generator = ' -G"Visual Studio 14 Win64"' maybe_generator = ' -A x64'
else: else:
maybe_generator = "" maybe_generator = ""
if sys.platform == "linux": if sys.platform == "linux":

View File

@ -153,6 +153,8 @@ class BuildExt(build_ext.build_ext): # pylint: disable=too-many-ancestors
'%s is used for building Windows distribution.', vs) '%s is used for building Windows distribution.', vs)
break break
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
shutil.rmtree(build_dir)
os.mkdir(build_dir)
continue continue
else: else:
gen = '-GNinja' if build_tool == 'ninja' else '-GUnix Makefiles' gen = '-GNinja' if build_tool == 'ninja' else '-GUnix Makefiles'

View File

@ -37,11 +37,6 @@
#if defined(_MSC_VER) #if defined(_MSC_VER)
#include <intrin.h> #include <intrin.h>
namespace {
inline int32_t __builtin_clzll(uint64_t x) {
return static_cast<int32_t>(__lzcnt64(x));
}
} // anonymous namespace
#endif #endif
/* /*
@ -288,8 +283,13 @@ struct RyuPowLogUtils {
return MulShift(m, kFloatPow5Split[i], j); // NOLINT return MulShift(m, kFloatPow5Split[i], j); // NOLINT
} }
static uint32_t FloorLog2(const uint64_t value) { static uint32_t FloorLog2(const uint32_t value) {
return 63 - __builtin_clzll(value); #if defined(_MSC_VER)
unsigned long index; // NOLINT
return _BitScanReverse(&index, value) ? index : 32;
#else
return 31 - __builtin_clz(value);
#endif
} }
/* /*