From 52b29b33bb7d3098fccf6092d3be51b15a9a8d91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cruz?= <124162252+lcruz99@users.noreply.github.com> Date: Wed, 4 Oct 2023 17:48:53 +0100 Subject: [PATCH] net: add apple tvos support (#6045) --- tokio-util/tests/udp.rs | 7 +++++-- tokio/src/net/unix/ucred.rs | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tokio-util/tests/udp.rs b/tokio-util/tests/udp.rs index 1b99806364c..db726a3d2b6 100644 --- a/tokio-util/tests/udp.rs +++ b/tokio-util/tests/udp.rs @@ -13,7 +13,10 @@ use futures::sink::SinkExt; use std::io; use std::sync::Arc; -#[cfg_attr(any(target_os = "macos", target_os = "ios"), allow(unused_assignments))] +#[cfg_attr( + any(target_os = "macos", target_os = "ios", target_os = "tvos"), + allow(unused_assignments) +)] #[tokio::test] async fn send_framed_byte_codec() -> std::io::Result<()> { let mut a_soc = UdpSocket::bind("127.0.0.1:0").await?; @@ -41,7 +44,7 @@ async fn send_framed_byte_codec() -> std::io::Result<()> { b_soc = b.into_inner(); } - #[cfg(not(any(target_os = "macos", target_os = "ios")))] + #[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "tvos")))] // test sending & receiving an empty message { let mut a = UdpFramed::new(a_soc, ByteCodec); diff --git a/tokio/src/net/unix/ucred.rs b/tokio/src/net/unix/ucred.rs index 43f008b21cb..b7d24ef482a 100644 --- a/tokio/src/net/unix/ucred.rs +++ b/tokio/src/net/unix/ucred.rs @@ -45,7 +45,7 @@ pub(crate) use self::impl_netbsd::get_peer_cred; #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] pub(crate) use self::impl_bsd::get_peer_cred; -#[cfg(any(target_os = "macos", target_os = "ios"))] +#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))] pub(crate) use self::impl_macos::get_peer_cred; #[cfg(any(target_os = "solaris", target_os = "illumos"))] @@ -187,7 +187,7 @@ pub(crate) mod impl_bsd { } } -#[cfg(any(target_os = "macos", target_os = "ios"))] +#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))] pub(crate) mod impl_macos { use crate::net::unix::{self, UnixStream};