From b99600db729777e0150e8994ad80644b32f492cb Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Tue, 8 Dec 2020 08:34:30 -0600 Subject: [PATCH] haiku: Fix sockaddr_in/sockaddr_in6; Solves #108 --- src/socket.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/socket.rs b/src/socket.rs index 17566d8..fb73877 100644 --- a/src/socket.rs +++ b/src/socket.rs @@ -118,6 +118,9 @@ fn addr2raw_v4(addr: &SocketAddrV4) -> (SocketAddrCRepr, c::socklen_t) { sin_family: c::AF_INET as c::sa_family_t, sin_port: addr.port().to_be(), sin_addr, + #[cfg(target_os = "haiku")] + sin_zero: [0; 24], + #[cfg(not(target_os = "haiku"))] sin_zero: [0; 8], #[cfg(any( target_os = "dragonfly", @@ -125,7 +128,8 @@ fn addr2raw_v4(addr: &SocketAddrV4) -> (SocketAddrCRepr, c::socklen_t) { target_os = "ios", target_os = "macos", target_os = "netbsd", - target_os = "openbsd" + target_os = "openbsd", + target_os = "haiku", ))] sin_len: 0, }, @@ -173,7 +177,8 @@ fn addr2raw_v6(addr: &SocketAddrV6) -> (SocketAddrCRepr, c::socklen_t) { target_os = "ios", target_os = "macos", target_os = "netbsd", - target_os = "openbsd" + target_os = "openbsd", + target_os = "haiku", ))] sin6_len: 0, #[cfg(any(target_os = "solaris", target_os = "illumos"))]