Fix warning

use of deprecated unit variant `cc::windows_registry::VsVers::Vs12`: Visual Studio 12 is no longer supported. cc will never return this value.
This commit is contained in:
gwenn 2024-07-20 09:33:36 +02:00
parent 7a66d4a632
commit a46ba32799

View File

@ -136,6 +136,7 @@ mod build_bundled {
.flag("-DSQLITE_THREADSAFE=1") .flag("-DSQLITE_THREADSAFE=1")
.flag("-DSQLITE_USE_URI") .flag("-DSQLITE_USE_URI")
.flag("-DHAVE_USLEEP=1") .flag("-DHAVE_USLEEP=1")
.flag("-DHAVE_ISNAN")
.flag("-D_POSIX_THREAD_SAFE_FUNCTIONS") // cross compile with MinGW .flag("-D_POSIX_THREAD_SAFE_FUNCTIONS") // cross compile with MinGW
.warnings(false); .warnings(false);
@ -235,25 +236,6 @@ mod build_bundled {
cfg.static_crt(true); cfg.static_crt(true);
} }
// Older versions of visual studio don't support c99 (including isnan), which
// causes a build failure when the linker fails to find the `isnan`
// function. `sqlite` provides its own implementation, using the fact
// that x != x when x is NaN.
//
// There may be other platforms that don't support `isnan`, they should be
// tested for here.
if is_compiler("msvc") {
use cc::windows_registry::{find_vs_version, VsVers};
let vs_has_nan = match find_vs_version() {
Ok(ver) => ver != VsVers::Vs12,
Err(_msg) => false,
};
if vs_has_nan {
cfg.flag("-DHAVE_ISNAN");
}
} else {
cfg.flag("-DHAVE_ISNAN");
}
if !win_target() { if !win_target() {
cfg.flag("-DHAVE_LOCALTIME_R"); cfg.flag("-DHAVE_LOCALTIME_R");
} }