Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update windows-bindgen to 0.52 #1361

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,11 @@ arbitrary = { version = "1.0.0", features = ["derive"], optional = true }
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.48", optional = true }
windows-targets = { version = "0.52", optional = true }

[target.'cfg(windows)'.dev-dependencies]
windows-bindgen = { version = "0.51" }
windows-bindgen = { version = "0.52" }

[target.'cfg(unix)'.dependencies]
iana-time-zone = { version = "0.1.45", optional = true, features = ["fallback"] }
Expand All @@ -56,9 +55,10 @@ iana-time-zone = { version = "0.1.45", optional = true, features = ["fallback"]
android-tzdata = { version = "0.1.1", optional = true }

[dev-dependencies]
bincode = { version = "1.3.0" }
serde_json = { version = "1" }
serde_derive = { version = "1", default-features = false }
bincode = { version = "1.3.0" }
similar-asserts = "1.5"

[target.'cfg(all(target_arch = "wasm32", not(any(target_os = "emscripten", target_os = "wasi"))))'.dev-dependencies]
wasm-bindgen-test = "0.3"
Expand Down
1 change: 1 addition & 0 deletions src/datetime/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ fn signed_duration_since_autoref() {
let dt1 = Utc.with_ymd_and_hms(2014, 5, 6, 7, 8, 9).unwrap();
let dt2 = Utc.with_ymd_and_hms(2014, 3, 4, 5, 6, 7).unwrap();
let diff1 = dt1.signed_duration_since(dt2); // Copy/consume
#[allow(clippy::needless_borrows_for_generic_args)]
let diff2 = dt2.signed_duration_since(&dt1); // Take by reference
assert_eq!(diff1, -diff2);

Expand Down
2 changes: 1 addition & 1 deletion src/offset/local/win_bindings.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Bindings generated by `windows-bindgen` 0.51.1
// Bindings generated by `windows-bindgen` 0.52.0

#![allow(non_snake_case, non_upper_case_globals, non_camel_case_types, dead_code, clippy::all)]
::windows_targets::link!("kernel32.dll" "system" fn SystemTimeToFileTime(lpsystemtime : *const SYSTEMTIME, lpfiletime : *mut FILETIME) -> BOOL);
Expand Down
9 changes: 4 additions & 5 deletions tests/win_bindings.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
#![cfg(all(windows, feature = "clock", feature = "std"))]

use similar_asserts::assert_eq;
use std::fs;
use windows_bindgen::bindgen;

#[test]
fn gen_bindings() {
let input = "src/offset/local/win_bindings.txt";
let output = "src/offset/local/win_bindings.rs";
let existing = fs::read_to_string(output).unwrap();
let existing = fs::read_to_string(output).unwrap().replace("\r\n", "\n");

let log = bindgen(["--etc", input]).unwrap();
eprintln!("{}", log);

// 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
// with `\n`. Compare line-by-line to ignore this difference.
let new = fs::read_to_string(output).unwrap();
if !new.lines().eq(existing.lines()) {
panic!("generated file `{}` is changed.", output);
}
let new = fs::read_to_string(output).unwrap().replace("\r\n", "\n");
assert_eq!(new, existing);
}