diff options
Diffstat (limited to 'vendor/rustix/src/backend/libc/net/write_sockaddr.rs')
-rw-r--r-- | vendor/rustix/src/backend/libc/net/write_sockaddr.rs | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/vendor/rustix/src/backend/libc/net/write_sockaddr.rs b/vendor/rustix/src/backend/libc/net/write_sockaddr.rs index 46f0ef40a..a354d9a85 100644 --- a/vendor/rustix/src/backend/libc/net/write_sockaddr.rs +++ b/vendor/rustix/src/backend/libc/net/write_sockaddr.rs @@ -21,9 +21,15 @@ pub(crate) unsafe fn write_sockaddr( } } -pub(crate) unsafe fn encode_sockaddr_v4(v4: &SocketAddrV4) -> c::sockaddr_in { +pub(crate) fn encode_sockaddr_v4(v4: &SocketAddrV4) -> c::sockaddr_in { c::sockaddr_in { - #[cfg(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto"))] + #[cfg(any( + bsd, + target_os = "aix", + target_os = "espidf", + target_os = "haiku", + target_os = "nto", + ))] sin_len: size_of::<c::sockaddr_in>() as _, sin_family: c::AF_INET as _, sin_port: u16::to_be(v4.port()), @@ -41,8 +47,14 @@ unsafe fn write_sockaddr_v4(v4: &SocketAddrV4, storage: *mut SocketAddrStorage) size_of::<c::sockaddr_in>() } -pub(crate) unsafe fn encode_sockaddr_v6(v6: &SocketAddrV6) -> c::sockaddr_in6 { - #[cfg(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto"))] +pub(crate) fn encode_sockaddr_v6(v6: &SocketAddrV6) -> c::sockaddr_in6 { + #[cfg(any( + bsd, + target_os = "aix", + target_os = "espidf", + target_os = "haiku", + target_os = "nto", + ))] { sockaddr_in6_new( size_of::<c::sockaddr_in6>() as _, @@ -53,7 +65,13 @@ pub(crate) unsafe fn encode_sockaddr_v6(v6: &SocketAddrV6) -> c::sockaddr_in6 { v6.scope_id(), ) } - #[cfg(not(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto")))] + #[cfg(not(any( + bsd, + target_os = "aix", + target_os = "espidf", + target_os = "haiku", + target_os = "nto" + )))] { sockaddr_in6_new( c::AF_INET6 as _, |