Skip to content

Commit 80a9717

Browse files
Rollup merge of #127320 - ChrisDenton:win-sys, r=Mark-Simulacrum
Update windows-bindgen to 0.58.0 This also switches from the bespoke `std` generated bindings to the normal `sys` ones everyone else uses. This has almost no difference except that the `sys` bindings use the `windows_targets::links!` macro for FFI imports, which we implement manually. This does cause the diff to look much larger than it really is but the bulk of the changes are mostly contained to the generated code.
2 parents 7a208c7 + 14f4ed2 commit 80a9717

File tree

8 files changed

+168
-856
lines changed

8 files changed

+168
-856
lines changed

Cargo.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -6356,9 +6356,9 @@ dependencies = [
63566356

63576357
[[package]]
63586358
name = "windows-bindgen"
6359-
version = "0.57.0"
6359+
version = "0.58.0"
63606360
source = "registry+https://github.com/rust-lang/crates.io-index"
6361-
checksum = "1ccb96113d6277ba543c0f77e1c5494af8094bf9daf9b85acdc3f1b620e7c7b4"
6361+
checksum = "91cd28d93c692351f3a6e5615567c56756e330bee1c99c6bdd57bfc5ab15f589"
63626362
dependencies = [
63636363
"proc-macro2",
63646364
"rayon",
@@ -6379,9 +6379,9 @@ dependencies = [
63796379

63806380
[[package]]
63816381
name = "windows-metadata"
6382-
version = "0.57.0"
6382+
version = "0.58.0"
63836383
source = "registry+https://github.com/rust-lang/crates.io-index"
6384-
checksum = "8308d076825b9d9e5abc64f8113e96d02b2aeeba869b20fdd65c7e70cda13dfc"
6384+
checksum = "2e837f3c3012cfe9e7086302a93f441a7999439be1ad4c530d55d2f6d2921809"
63856385

63866386
[[package]]
63876387
name = "windows-sys"

library/std/src/sys/pal/windows/c.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ use crate::os::raw::{c_char, c_long, c_longlong, c_uint, c_ulong, c_ushort, c_vo
1313
use crate::os::windows::io::{AsRawHandle, BorrowedHandle};
1414
use crate::ptr;
1515

16+
mod windows_targets;
17+
1618
mod windows_sys;
1719
pub use windows_sys::*;
1820

@@ -504,11 +506,8 @@ if #[cfg(not(target_vendor = "uwp"))] {
504506
#[cfg(target_arch = "arm")]
505507
pub enum CONTEXT {}
506508
}}
507-
508-
#[link(name = "ws2_32")]
509-
extern "system" {
510-
pub fn WSAStartup(wversionrequested: u16, lpwsadata: *mut WSADATA) -> i32;
511-
}
509+
// WSAStartup is only redefined here so that we can override WSADATA for Arm32
510+
windows_targets::link!("ws2_32.dll" "system" fn WSAStartup(wversionrequested: u16, lpwsadata: *mut WSADATA) -> i32);
512511
#[cfg(target_arch = "arm")]
513512
#[repr(C)]
514513
pub struct WSADATA {

library/std/src/sys/pal/windows/c/bindings.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--out windows_sys.rs
2-
--config flatten std
2+
--config flatten sys
33
--filter
44
!Windows.Win32.Foundation.INVALID_HANDLE_VALUE
55
Windows.Wdk.Storage.FileSystem.FILE_COMPLETE_IF_OPLOCKED

0 commit comments

Comments
 (0)