about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-06-12 17:23:48 +0000
committerbors <bors@rust-lang.org>2023-06-12 17:23:48 +0000
commitdf77afbcaf3365a32066a8ca4a00ae6fc9a69647 (patch)
tree1d88c226fa8e26cb089a7f56d6b92e190aa27de3 /src
parentb963a57205e548e8538a8182b1c273ea75007614 (diff)
parent9cb785b9d3cb07ba52691ab4f8e6cb0a91d7d9aa (diff)
downloadrust-df77afbcaf3365a32066a8ca4a00ae6fc9a69647.tar.gz
rust-df77afbcaf3365a32066a8ca4a00ae6fc9a69647.zip
Auto merge of #112563 - matthiaskrgr:rollup-ebetrzi, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #112302 (Suggest using `ptr::null_mut` when user provided `ptr::null` to a function expecting `ptr::null_mut`)
 - #112416 (Fix debug ICE for extern type with where clauses)
 - #112527 (Add windows_sys type definitions for ARM32 manually)
 - #112546 (new solver: extend assert to other aliases)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src')
-rw-r--r--src/tools/generate-windows-sys/src/arm_shim.rs20
-rw-r--r--src/tools/generate-windows-sys/src/main.rs4
2 files changed, 24 insertions, 0 deletions
diff --git a/src/tools/generate-windows-sys/src/arm_shim.rs b/src/tools/generate-windows-sys/src/arm_shim.rs
new file mode 100644
index 00000000000..17c2ccb223c
--- /dev/null
+++ b/src/tools/generate-windows-sys/src/arm_shim.rs
@@ -0,0 +1,20 @@
+// Begin of ARM32 shim
+// The raw content of this file should be processed by `generate-windows-sys`
+// to be merged with the generated binding. It is not supposed to be used as
+// a normal Rust module.
+cfg_if::cfg_if! {
+if #[cfg(target_arch = "arm")] {
+#[repr(C)]
+pub struct WSADATA {
+    pub wVersion: u16,
+    pub wHighVersion: u16,
+    pub szDescription: [u8; 257],
+    pub szSystemStatus: [u8; 129],
+    pub iMaxSockets: u16,
+    pub iMaxUdpDg: u16,
+    pub lpVendorInfo: PSTR,
+}
+pub enum CONTEXT {}
+}
+}
+// End of ARM32 shim
diff --git a/src/tools/generate-windows-sys/src/main.rs b/src/tools/generate-windows-sys/src/main.rs
index 91d981462e8..65e480715ee 100644
--- a/src/tools/generate-windows-sys/src/main.rs
+++ b/src/tools/generate-windows-sys/src/main.rs
@@ -11,6 +11,9 @@ const PRELUDE: &str = r#"// This file is autogenerated.
 // ignore-tidy-filelength
 "#;
 
+/// This is a shim for the ARM (32-bit) architecture, which is no longer supported by windows-rs.
+const ARM_SHIM: &str = include_str!("arm_shim.rs");
+
 fn main() -> io::Result<()> {
     let mut path: PathBuf =
         std::env::args_os().nth(1).expect("a path to the rust repository is required").into();
@@ -32,6 +35,7 @@ fn main() -> io::Result<()> {
     let mut f = std::fs::File::create(&path)?;
     f.write_all(PRELUDE.as_bytes())?;
     f.write_all(bindings.as_bytes())?;
+    f.write_all(ARM_SHIM.as_bytes())?;
 
     Ok(())
 }