diff options
| author | Chris Denton <chris@chrisdenton.dev> | 2024-07-14 06:53:28 +0000 |
|---|---|---|
| committer | Chris Denton <chris@chrisdenton.dev> | 2024-07-15 05:01:20 +0000 |
| commit | f2cc94361c70ca792a783ad858e2a2b68aedb4a5 (patch) | |
| tree | 9e35a134396d485c41ba23c45fb09d62624fb6d7 | |
| parent | e70cc288311e907f721e5dff9201be18c4e42640 (diff) | |
| download | rust-f2cc94361c70ca792a783ad858e2a2b68aedb4a5.tar.gz rust-f2cc94361c70ca792a783ad858e2a2b68aedb4a5.zip | |
Remove USHORT
We stick to C types in for socket and address as these are at least nominally BSD-ish and they're used outside of pal/windows in general *nix code
| -rw-r--r-- | library/std/src/sys/pal/windows/c.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/library/std/src/sys/pal/windows/c.rs b/library/std/src/sys/pal/windows/c.rs index 97fec6e59f0..20f1ff84b7b 100644 --- a/library/std/src/sys/pal/windows/c.rs +++ b/library/std/src/sys/pal/windows/c.rs @@ -19,7 +19,6 @@ pub use windows_sys::*; pub type DWORD = c_ulong; pub type WCHAR = u16; -pub type USHORT = c_ushort; pub type SIZE_T = usize; pub type CHAR = c_char; pub type ULONG = c_ulong; @@ -33,7 +32,7 @@ pub type LPVOID = *mut c_void; pub type PSRWLOCK = *mut SRWLOCK; pub type socklen_t = c_int; -pub type ADDRESS_FAMILY = USHORT; +pub type ADDRESS_FAMILY = c_ushort; pub use FD_SET as fd_set; pub use LINGER as linger; pub use TIMEVAL as timeval; @@ -152,7 +151,7 @@ pub struct SOCKADDR_STORAGE_LH { #[derive(Copy, Clone)] pub struct sockaddr_in { pub sin_family: ADDRESS_FAMILY, - pub sin_port: USHORT, + pub sin_port: c_ushort, pub sin_addr: in_addr, pub sin_zero: [CHAR; 8], } @@ -161,7 +160,7 @@ pub struct sockaddr_in { #[derive(Copy, Clone)] pub struct sockaddr_in6 { pub sin6_family: ADDRESS_FAMILY, - pub sin6_port: USHORT, + pub sin6_port: c_ushort, pub sin6_flowinfo: c_ulong, pub sin6_addr: in6_addr, pub sin6_scope_id: c_ulong, |
