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

[EXPERIMENT]: Use Windows sys bindings and add raw-dylib feature #126913

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
6 changes: 2 additions & 4 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6324,8 +6324,7 @@ dependencies = [
[[package]]
name = "windows-bindgen"
version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ccb96113d6277ba543c0f77e1c5494af8094bf9daf9b85acdc3f1b620e7c7b4"
source = "git+https://github.com/microsoft/windows-rs.git#863a7cf1d05096c09f2c7cac13ff9f5c9abec61e"
dependencies = [
"proc-macro2",
"rayon",
Expand All @@ -6347,8 +6346,7 @@ dependencies = [
[[package]]
name = "windows-metadata"
version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8308d076825b9d9e5abc64f8113e96d02b2aeeba869b20fdd65c7e70cda13dfc"
source = "git+https://github.com/microsoft/windows-rs.git#863a7cf1d05096c09f2c7cac13ff9f5c9abec61e"

[[package]]
name = "windows-sys"
Expand Down
4 changes: 4 additions & 0 deletions library/std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ std_detect_file_io = ["std_detect/std_detect_file_io"]
std_detect_dlsym_getauxval = ["std_detect/std_detect_dlsym_getauxval"]
std_detect_env_override = ["std_detect/std_detect_env_override"]

# Enable using raw-dylib for Windows imports.
# This will eventually be the default.
windows_raw_dylib = []

[package.metadata.fortanix-sgx]
# Maximum possible number of threads when testing
threads = 125
Expand Down
4 changes: 3 additions & 1 deletion library/std/src/sys/pal/windows/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ use crate::os::raw::{c_char, c_long, c_longlong, c_uint, c_ulong, c_ushort, c_vo
use crate::os::windows::io::{AsRawHandle, BorrowedHandle};
use crate::ptr;

mod windows_targets;

mod windows_sys;
pub use windows_sys::*;

Expand Down Expand Up @@ -503,7 +505,7 @@ if #[cfg(not(target_vendor = "uwp"))] {
#[cfg(target_arch = "arm")]
pub enum CONTEXT {}
}}

// WSAStartup is only redefined here so that we can override WSADATA for Arm32
#[link(name = "ws2_32")]
extern "system" {
pub fn WSAStartup(wversionrequested: u16, lpwsadata: *mut WSADATA) -> i32;
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sys/pal/windows/c/bindings.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--out windows_sys.rs
--config flatten std
--config flatten sys
--filter
!Windows.Win32.Foundation.INVALID_HANDLE_VALUE
Windows.Wdk.Storage.FileSystem.FILE_COMPLETE_IF_OPLOCKED
Expand Down
Loading
Loading