Skip to content

Commit

Permalink
Remove USHORT
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ChrisDenton committed Jul 15, 2024
1 parent d621d21 commit 00a5b3b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions std/src/sys/pal/windows/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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],
}
Expand All @@ -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,
Expand Down

0 comments on commit 00a5b3b

Please sign in to comment.