diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 26a531c7..3a1b10f4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -60,6 +60,7 @@ jobs: - aarch64-apple-darwin - aarch64-apple-ios - aarch64-apple-tvos + - aarch64-apple-visionos - aarch64-apple-watchos - aarch64-linux-android - aarch64-unknown-freebsd diff --git a/src/lib.rs b/src/lib.rs index c3161d63..8f593163 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -515,6 +515,7 @@ impl TcpKeepalive { target_os = "fuchsia", target_os = "illumos", target_os = "ios", + target_os = "visionos", target_os = "linux", target_os = "macos", target_os = "netbsd", @@ -531,6 +532,7 @@ impl TcpKeepalive { target_os = "fuchsia", target_os = "illumos", target_os = "ios", + target_os = "visionos", target_os = "linux", target_os = "macos", target_os = "netbsd", @@ -559,6 +561,7 @@ impl TcpKeepalive { target_os = "fuchsia", target_os = "illumos", target_os = "ios", + target_os = "visionos", target_os = "linux", target_os = "macos", target_os = "netbsd", @@ -577,6 +580,7 @@ impl TcpKeepalive { target_os = "fuchsia", target_os = "illumos", target_os = "ios", + target_os = "visionos", target_os = "linux", target_os = "macos", target_os = "netbsd", diff --git a/src/sockaddr.rs b/src/sockaddr.rs index 2f4b40ed..c80dccf3 100644 --- a/src/sockaddr.rs +++ b/src/sockaddr.rs @@ -291,6 +291,7 @@ impl From for SockAddr { target_os = "haiku", target_os = "hermit", target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "netbsd", target_os = "nto", @@ -334,6 +335,7 @@ impl From for SockAddr { target_os = "haiku", target_os = "hermit", target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "netbsd", target_os = "nto", @@ -358,6 +360,7 @@ impl fmt::Debug for SockAddr { target_os = "haiku", target_os = "hermit", target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "netbsd", target_os = "nto", diff --git a/src/socket.rs b/src/socket.rs index e0ccf8e4..8d517b47 100644 --- a/src/socket.rs +++ b/src/socket.rs @@ -801,6 +801,7 @@ fn set_common_flags(socket: Socket) -> io::Result { // On Apple platforms set `NOSIGPIPE`. #[cfg(any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -2048,6 +2049,7 @@ impl Socket { target_os = "fuchsia", target_os = "illumos", target_os = "ios", + target_os = "visionos", target_os = "linux", target_os = "macos", target_os = "netbsd", @@ -2066,6 +2068,7 @@ impl Socket { target_os = "fuchsia", target_os = "illumos", target_os = "ios", + target_os = "visionos", target_os = "linux", target_os = "macos", target_os = "netbsd", @@ -2095,6 +2098,7 @@ impl Socket { target_os = "fuchsia", target_os = "illumos", target_os = "ios", + target_os = "visionos", target_os = "linux", target_os = "macos", target_os = "netbsd", @@ -2113,6 +2117,7 @@ impl Socket { target_os = "fuchsia", target_os = "illumos", target_os = "ios", + target_os = "visionos", target_os = "linux", target_os = "macos", target_os = "netbsd", diff --git a/src/sys/unix.rs b/src/sys/unix.rs index 51ef4a5d..3a898bc3 100644 --- a/src/sys/unix.rs +++ b/src/sys/unix.rs @@ -18,6 +18,7 @@ use std::net::{Ipv4Addr, Ipv6Addr}; feature = "all", any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -31,6 +32,7 @@ use std::num::NonZeroU32; target_os = "android", target_os = "freebsd", target_os = "ios", + target_os = "visionos", target_os = "linux", target_os = "macos", target_os = "tvos", @@ -46,6 +48,7 @@ use std::os::unix::ffi::OsStrExt; target_os = "android", target_os = "freebsd", target_os = "ios", + target_os = "visionos", target_os = "linux", target_os = "macos", target_os = "tvos", @@ -63,6 +66,7 @@ use std::{io, slice}; #[cfg(not(any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -160,6 +164,7 @@ pub(crate) use libc::IP_RECVTOS; pub(crate) use libc::IP_TOS; #[cfg(not(any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -167,6 +172,7 @@ pub(crate) use libc::IP_TOS; pub(crate) use libc::SO_LINGER; #[cfg(any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -202,6 +208,7 @@ pub(crate) use libc::{ target_os = "haiku", target_os = "illumos", target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "netbsd", target_os = "nto", @@ -217,6 +224,7 @@ pub(crate) use libc::{IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP}; target_os = "haiku", target_os = "illumos", target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "netbsd", target_os = "openbsd", @@ -236,6 +244,7 @@ pub(crate) use libc::{ target_os = "fuchsia", target_os = "illumos", target_os = "ios", + target_os = "visionos", target_os = "linux", target_os = "macos", target_os = "netbsd", @@ -250,6 +259,7 @@ pub(crate) type Bool = c_int; #[cfg(any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "nto", target_os = "tvos", @@ -259,6 +269,7 @@ use libc::TCP_KEEPALIVE as KEEPALIVE_TIME; #[cfg(not(any( target_os = "haiku", target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "nto", target_os = "openbsd", @@ -284,6 +295,7 @@ macro_rules! syscall { /// Maximum size of a buffer passed to system call like `recv` and `send`. #[cfg(not(any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -300,6 +312,7 @@ const MAX_BUF_LEN: usize = ssize_t::MAX as usize; // both platforms. #[cfg(any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -339,6 +352,7 @@ type IovLen = usize; target_os = "hurd", target_os = "illumos", target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "netbsd", target_os = "nto", @@ -1234,6 +1248,7 @@ pub(crate) fn set_tcp_keepalive(fd: Socket, keepalive: &TcpKeepalive) -> io::Res target_os = "hurd", target_os = "illumos", target_os = "ios", + target_os = "visionos", target_os = "linux", target_os = "macos", target_os = "netbsd", @@ -1462,6 +1477,7 @@ impl crate::Socket { #[cfg_attr( any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos" @@ -1498,6 +1514,7 @@ impl crate::Socket { feature = "all", any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -1509,6 +1526,7 @@ impl crate::Socket { feature = "all", any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -1521,6 +1539,7 @@ impl crate::Socket { #[cfg(any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -1957,6 +1976,7 @@ impl crate::Socket { feature = "all", any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -1968,6 +1988,7 @@ impl crate::Socket { feature = "all", any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -1993,6 +2014,7 @@ impl crate::Socket { feature = "all", any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -2004,6 +2026,7 @@ impl crate::Socket { feature = "all", any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -2029,6 +2052,7 @@ impl crate::Socket { feature = "all", any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -2040,6 +2064,7 @@ impl crate::Socket { feature = "all", any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -2060,6 +2085,7 @@ impl crate::Socket { feature = "all", any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -2071,6 +2097,7 @@ impl crate::Socket { feature = "all", any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -2088,6 +2115,7 @@ impl crate::Socket { feature = "all", any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -2099,6 +2127,7 @@ impl crate::Socket { feature = "all", any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -2119,6 +2148,7 @@ impl crate::Socket { feature = "all", any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -2130,6 +2160,7 @@ impl crate::Socket { feature = "all", any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -2453,6 +2484,7 @@ impl crate::Socket { target_os = "android", target_os = "freebsd", target_os = "ios", + target_os = "visionos", target_os = "linux", target_os = "macos", target_os = "tvos", @@ -2468,6 +2500,7 @@ impl crate::Socket { target_os = "android", target_os = "freebsd", target_os = "ios", + target_os = "visionos", target_os = "linux", target_os = "macos", target_os = "tvos", @@ -2491,6 +2524,7 @@ impl crate::Socket { feature = "all", any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", diff --git a/tests/socket.rs b/tests/socket.rs index 8e22542d..2300f0ed 100644 --- a/tests/socket.rs +++ b/tests/socket.rs @@ -5,6 +5,7 @@ target_os = "android", target_os = "freebsd", target_os = "ios", + target_os = "visionos", target_os = "linux", target_os = "macos", target_os = "tvos", @@ -29,6 +30,7 @@ use std::net::{Ipv6Addr, SocketAddrV6}; target_os = "android", target_os = "freebsd", target_os = "ios", + target_os = "visionos", target_os = "linux", target_os = "macos", target_os = "tvos", @@ -225,6 +227,7 @@ fn assert_common_flags(socket: &Socket, expected: bool) { assert_close_on_exec(socket, expected); #[cfg(any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -416,6 +419,7 @@ where feature = "all", any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -436,6 +440,7 @@ fn set_nosigpipe() { /// Assert that `SO_NOSIGPIPE` is set on `socket`. #[cfg(any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -864,6 +869,7 @@ fn tcp_keepalive() { target_os = "freebsd", target_os = "fuchsia", target_os = "ios", + target_os = "visionos", target_os = "linux", target_os = "macos", target_os = "netbsd", @@ -881,6 +887,7 @@ fn tcp_keepalive() { target_os = "freebsd", target_os = "fuchsia", target_os = "ios", + target_os = "visionos", target_os = "linux", target_os = "macos", target_os = "netbsd", @@ -908,6 +915,7 @@ fn tcp_keepalive() { target_os = "fuchsia", target_os = "illumos", target_os = "ios", + target_os = "visionos", target_os = "linux", target_os = "macos", target_os = "netbsd", @@ -929,6 +937,7 @@ fn tcp_keepalive() { target_os = "fuchsia", target_os = "illumos", target_os = "ios", + target_os = "visionos", target_os = "linux", target_os = "macos", target_os = "netbsd", @@ -977,6 +986,7 @@ fn device() { feature = "all", any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -1022,6 +1032,7 @@ fn device() { feature = "all", any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos", @@ -1069,6 +1080,7 @@ fn device_v6() { target_os = "android", target_os = "freebsd", target_os = "ios", + target_os = "visionos", target_os = "linux", target_os = "macos", target_os = "tvos", @@ -1226,6 +1238,7 @@ fn r#type() { unix, not(any( target_os = "ios", + target_os = "visionos", target_os = "macos", target_os = "tvos", target_os = "watchos",