net: add Apple watchOS support (#6176)

This commit is contained in:
simlay 2023-11-29 15:16:48 -05:00 committed by GitHub
parent 3468b4b72f
commit 4c33ed33f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 4 deletions

View File

@ -14,7 +14,12 @@ use std::io;
use std::sync::Arc;
#[cfg_attr(
any(target_os = "macos", target_os = "ios", target_os = "tvos"),
any(
target_os = "macos",
target_os = "ios",
target_os = "tvos",
target_os = "watchos"
),
allow(unused_assignments)
)]
#[tokio::test]
@ -44,7 +49,12 @@ async fn send_framed_byte_codec() -> std::io::Result<()> {
b_soc = b.into_inner();
}
#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "tvos")))]
#[cfg(not(any(
target_os = "macos",
target_os = "ios",
target_os = "tvos",
target_os = "watchos"
)))]
// test sending & receiving an empty message
{
let mut a = UdpFramed::new(a_soc, ByteCodec);

View File

@ -45,7 +45,12 @@ 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", target_os = "tvos"))]
#[cfg(any(
target_os = "macos",
target_os = "ios",
target_os = "tvos",
target_os = "watchos"
))]
pub(crate) use self::impl_macos::get_peer_cred;
#[cfg(any(target_os = "solaris", target_os = "illumos"))]
@ -187,7 +192,12 @@ pub(crate) mod impl_bsd {
}
}
#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
#[cfg(any(
target_os = "macos",
target_os = "ios",
target_os = "tvos",
target_os = "watchos"
))]
pub(crate) mod impl_macos {
use crate::net::unix::{self, UnixStream};