Skip to content

Commit 3b4214d

Browse files
linkmauveThomasdezeeuw
authored andcommitted
Fix compilation on Haiku
sin_len and sin6_len are apparently required on all BSD-like systems, from which Haiku probably inherits its network stack. sin_zero has been changed from 8 bytes to 24 bytes in hrev9079 in order to stay compatible with BeOS.
1 parent 7312f81 commit 3b4214d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sockaddr.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,11 @@ impl From<SocketAddrV4> for SockAddr {
216216
sin_family: AF_INET as sa_family_t,
217217
sin_port: addr.port().to_be(),
218218
sin_addr,
219-
sin_zero: [0; 8],
219+
sin_zero: Default::default(),
220220
#[cfg(any(
221221
target_os = "dragonfly",
222222
target_os = "freebsd",
223+
target_os = "haiku",
223224
target_os = "ios",
224225
target_os = "macos",
225226
target_os = "netbsd",
@@ -268,6 +269,7 @@ impl From<SocketAddrV6> for SockAddr {
268269
#[cfg(any(
269270
target_os = "dragonfly",
270271
target_os = "freebsd",
272+
target_os = "haiku",
271273
target_os = "ios",
272274
target_os = "macos",
273275
target_os = "netbsd",

0 commit comments

Comments
 (0)