Skip to content

Commit 396be64

Browse files
committed
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
1 parent c3585b6 commit 396be64

File tree

1 file changed

+3
-4
lines changed
  • library/std/src/sys/pal/windows

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ mod windows_sys;
1818
pub use windows_sys::*;
1919

2020
pub type DWORD = c_ulong;
21-
pub type USHORT = c_ushort;
2221
pub type SIZE_T = usize;
2322
pub type CHAR = c_char;
2423
pub type ULONG = c_ulong;
@@ -32,7 +31,7 @@ pub type LPVOID = *mut c_void;
3231
pub type PSRWLOCK = *mut SRWLOCK;
3332

3433
pub type socklen_t = c_int;
35-
pub type ADDRESS_FAMILY = USHORT;
34+
pub type ADDRESS_FAMILY = c_ushort;
3635
pub use FD_SET as fd_set;
3736
pub use LINGER as linger;
3837
pub use TIMEVAL as timeval;
@@ -151,7 +150,7 @@ pub struct SOCKADDR_STORAGE_LH {
151150
#[derive(Copy, Clone)]
152151
pub struct sockaddr_in {
153152
pub sin_family: ADDRESS_FAMILY,
154-
pub sin_port: USHORT,
153+
pub sin_port: c_ushort,
155154
pub sin_addr: in_addr,
156155
pub sin_zero: [CHAR; 8],
157156
}
@@ -160,7 +159,7 @@ pub struct sockaddr_in {
160159
#[derive(Copy, Clone)]
161160
pub struct sockaddr_in6 {
162161
pub sin6_family: ADDRESS_FAMILY,
163-
pub sin6_port: USHORT,
162+
pub sin6_port: c_ushort,
164163
pub sin6_flowinfo: c_ulong,
165164
pub sin6_addr: in6_addr,
166165
pub sin6_scope_id: c_ulong,

0 commit comments

Comments
 (0)