mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Add windows_sys typedef for Win ARM32
This commit is contained in:
parent
cb882fa998
commit
f7f25b0e2f
@ -4275,3 +4275,20 @@ impl ::core::clone::Clone for XSAVE_FORMAT {
|
||||
*self
|
||||
}
|
||||
}
|
||||
// Begin of ARM32 shim
|
||||
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
|
||||
|
17
src/tools/generate-windows-sys/src/arm_shim.rs
Normal file
17
src/tools/generate-windows-sys/src/arm_shim.rs
Normal file
@ -0,0 +1,17 @@
|
||||
// Begin of ARM32 shim
|
||||
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
|
@ -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(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user