Skip to content

Commit 6354d3b

Browse files
committed
WIP: switch to sys
1 parent 725e9ee commit 6354d3b

File tree

8 files changed

+179
-843
lines changed

8 files changed

+179
-843
lines changed

Cargo.lock

+2-4
Original file line numberDiff line numberDiff line change
@@ -6324,8 +6324,7 @@ dependencies = [
63246324
[[package]]
63256325
name = "windows-bindgen"
63266326
version = "0.57.0"
6327-
source = "registry+https://github.com/rust-lang/crates.io-index"
6328-
checksum = "1ccb96113d6277ba543c0f77e1c5494af8094bf9daf9b85acdc3f1b620e7c7b4"
6327+
source = "git+https://github.com/microsoft/windows-rs.git#863a7cf1d05096c09f2c7cac13ff9f5c9abec61e"
63296328
dependencies = [
63306329
"proc-macro2",
63316330
"rayon",
@@ -6347,8 +6346,7 @@ dependencies = [
63476346
[[package]]
63486347
name = "windows-metadata"
63496348
version = "0.57.0"
6350-
source = "registry+https://github.com/rust-lang/crates.io-index"
6351-
checksum = "8308d076825b9d9e5abc64f8113e96d02b2aeeba869b20fdd65c7e70cda13dfc"
6349+
source = "git+https://github.com/microsoft/windows-rs.git#863a7cf1d05096c09f2c7cac13ff9f5c9abec61e"
63526350

63536351
[[package]]
63546352
name = "windows-sys"

library/std/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ std_detect_file_io = ["std_detect/std_detect_file_io"]
8787
std_detect_dlsym_getauxval = ["std_detect/std_detect_dlsym_getauxval"]
8888
std_detect_env_override = ["std_detect/std_detect_env_override"]
8989

90+
# Enable using raw-dylib for Windows imports.
91+
# This will eventually be the default.
92+
windows_raw_dylib = []
93+
9094
[package.metadata.fortanix-sgx]
9195
# Maximum possible number of threads when testing
9296
threads = 125

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

+3-1
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

@@ -503,7 +505,7 @@ if #[cfg(not(target_vendor = "uwp"))] {
503505
#[cfg(target_arch = "arm")]
504506
pub enum CONTEXT {}
505507
}}
506-
508+
// WSAStartup is only redefined here so that we can override WSADATA for Arm32
507509
#[link(name = "ws2_32")]
508510
extern "system" {
509511
pub fn WSAStartup(wversionrequested: u16, lpwsadata: *mut WSADATA) -> i32;

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)