From 07216ae8fdc29073969920cb4957793dd47565e4 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Mon, 24 Feb 2025 13:47:49 +0100 Subject: [PATCH] Upgrade to windows-bindgen 0.60 --- Cargo.toml | 6 +++--- src/offset/local/win_bindings.rs | 8 ++++---- tests/win_bindings.rs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 78d79fb8..8c3d3125 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ name = "chrono" default = ["clock", "std", "oldtime", "wasmbind"] alloc = [] libc = [] -winapi = ["windows-targets"] +winapi = ["windows-link"] std = ["alloc"] clock = ["winapi", "iana-time-zone", "android-tzdata", "now"] now = ["std"] @@ -49,10 +49,10 @@ wasm-bindgen = { version = "0.2", optional = true } js-sys = { version = "0.3", optional = true } # contains FFI bindings for the JS Date API [target.'cfg(windows)'.dependencies] -windows-targets = { version = "0.53", optional = true } +windows-link = { version = "0.1", optional = true } [target.'cfg(windows)'.dev-dependencies] -windows-bindgen = { version = "0.59" } # MSRV is 1.74 +windows-bindgen = { version = "0.60" } # MSRV is 1.74 [target.'cfg(unix)'.dependencies] iana-time-zone = { version = "0.1.45", optional = true, features = ["fallback"] } diff --git a/src/offset/local/win_bindings.rs b/src/offset/local/win_bindings.rs index f2def25e..b8e6b6d2 100644 --- a/src/offset/local/win_bindings.rs +++ b/src/offset/local/win_bindings.rs @@ -1,9 +1,9 @@ #![allow(non_snake_case, non_upper_case_globals, non_camel_case_types, dead_code, clippy::all)] -windows_targets::link!("kernel32.dll" "system" fn GetTimeZoneInformationForYear(wyear : u16, pdtzi : *const DYNAMIC_TIME_ZONE_INFORMATION, ptzi : *mut TIME_ZONE_INFORMATION) -> BOOL); -windows_targets::link!("kernel32.dll" "system" fn SystemTimeToFileTime(lpsystemtime : *const SYSTEMTIME, lpfiletime : *mut FILETIME) -> BOOL); -windows_targets::link!("kernel32.dll" "system" fn SystemTimeToTzSpecificLocalTime(lptimezoneinformation : *const TIME_ZONE_INFORMATION, lpuniversaltime : *const SYSTEMTIME, lplocaltime : *mut SYSTEMTIME) -> BOOL); -windows_targets::link!("kernel32.dll" "system" fn TzSpecificLocalTimeToSystemTime(lptimezoneinformation : *const TIME_ZONE_INFORMATION, lplocaltime : *const SYSTEMTIME, lpuniversaltime : *mut SYSTEMTIME) -> BOOL); +windows_link::link!("kernel32.dll" "system" fn GetTimeZoneInformationForYear(wyear : u16, pdtzi : *const DYNAMIC_TIME_ZONE_INFORMATION, ptzi : *mut TIME_ZONE_INFORMATION) -> BOOL); +windows_link::link!("kernel32.dll" "system" fn SystemTimeToFileTime(lpsystemtime : *const SYSTEMTIME, lpfiletime : *mut FILETIME) -> BOOL); +windows_link::link!("kernel32.dll" "system" fn SystemTimeToTzSpecificLocalTime(lptimezoneinformation : *const TIME_ZONE_INFORMATION, lpuniversaltime : *const SYSTEMTIME, lplocaltime : *mut SYSTEMTIME) -> BOOL); +windows_link::link!("kernel32.dll" "system" fn TzSpecificLocalTimeToSystemTime(lptimezoneinformation : *const TIME_ZONE_INFORMATION, lplocaltime : *const SYSTEMTIME, lpuniversaltime : *mut SYSTEMTIME) -> BOOL); pub type BOOL = i32; #[repr(C)] #[derive(Clone, Copy)] diff --git a/tests/win_bindings.rs b/tests/win_bindings.rs index ea8913bb..d3c2bc3a 100644 --- a/tests/win_bindings.rs +++ b/tests/win_bindings.rs @@ -9,7 +9,7 @@ fn gen_bindings() { let output = "src/offset/local/win_bindings.rs"; let existing = fs::read_to_string(output).unwrap(); - bindgen(["--etc", input]); + bindgen(["--no-deps", "--etc", input]); // Check the output is the same as before. // Depending on the git configuration the file may have been checked out with `\r\n` newlines or