Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for visionOS #202

Merged
merged 2 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions examples/kqueue-process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
//! ```

#[cfg(any(
target_os = "macos",
target_os = "ios",
target_os = "tvos",
target_os = "watchos",
target_vendor = "apple",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd",
Expand Down Expand Up @@ -40,10 +37,7 @@ fn main() -> std::io::Result<()> {
}

#[cfg(not(any(
target_os = "macos",
target_os = "ios",
target_os = "tvos",
target_os = "watchos",
target_vendor = "apple",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd",
Expand Down
25 changes: 5 additions & 20 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@ unsafe impl<T: IoSafe + Write> IoSafe for std::io::BufWriter<T> {}
unsafe impl<T: IoSafe + Write> IoSafe for std::io::LineWriter<T> {}
unsafe impl<T: IoSafe + ?Sized> IoSafe for &mut T {}
unsafe impl<T: IoSafe + ?Sized> IoSafe for Box<T> {}
unsafe impl<T: Clone + IoSafe + ?Sized> IoSafe for std::borrow::Cow<'_, T> {}
unsafe impl<T: Clone + IoSafe> IoSafe for std::borrow::Cow<'_, T> {}

impl<T: IoSafe + Read> AsyncRead for Async<T> {
fn poll_read(
Expand Down Expand Up @@ -2101,20 +2101,14 @@ fn connect(
let socket = {
#[cfg(not(any(
target_os = "aix",
target_os = "macos",
target_os = "ios",
target_os = "tvos",
target_os = "watchos",
target_vendor = "apple",
target_os = "espidf",
windows,
)))]
let flags = rn::SocketFlags::CLOEXEC;
#[cfg(any(
target_os = "aix",
target_os = "macos",
target_os = "ios",
target_os = "tvos",
target_os = "watchos",
target_vendor = "apple",
target_os = "espidf",
windows,
))]
Expand All @@ -2124,13 +2118,7 @@ fn connect(
let socket = rn::socket_with(domain, rn::SocketType::STREAM, flags, protocol)?;

// Set cloexec if necessary.
#[cfg(any(
target_os = "aix",
target_os = "macos",
target_os = "ios",
target_os = "tvos",
target_os = "watchos",
))]
#[cfg(any(target_os = "aix", target_vendor = "apple"))]
rio::fcntl_setfd(&socket, rio::fcntl_getfd(&socket)? | rio::FdFlags::CLOEXEC)?;

// Set non-blocking mode.
Expand All @@ -2141,10 +2129,7 @@ fn connect(

// Set nosigpipe if necessary.
#[cfg(any(
target_os = "macos",
target_os = "ios",
target_os = "tvos",
target_os = "watchos",
target_vendor = "apple",
target_os = "freebsd",
target_os = "netbsd",
target_os = "dragonfly",
Expand Down
5 changes: 1 addition & 4 deletions src/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
pub mod unix;

#[cfg(any(
target_os = "macos",
target_os = "ios",
target_os = "tvos",
target_os = "watchos",
target_vendor = "apple",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd",
Expand Down
5 changes: 1 addition & 4 deletions src/os/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ pub fn reactor_fd() -> Option<BorrowedFd<'static>> {
target_os = "android",
target_os = "illumos",
target_os = "solaris",
target_os = "macos",
target_os = "ios",
target_os = "tvos",
target_os = "watchos",
target_vendor = "apple",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd",
Expand Down
5 changes: 1 addition & 4 deletions src/reactor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ cfg_if::cfg_if! {
mod windows;
pub use windows::Registration;
} else if #[cfg(any(
target_os = "macos",
target_os = "ios",
target_os = "tvos",
target_os = "watchos",
target_vendor = "apple",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd",
Expand Down
Loading