Skip to content

Commit

Permalink
Add support for visionOS (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm authored Sep 14, 2024
1 parent 7531821 commit 7145cd2
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 55 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Portable interface to epoll, kqueue, event ports, and IOCP.

Supported platforms:
- [epoll](https://en.wikipedia.org/wiki/Epoll): Linux, Android, RedoxOS
- [kqueue](https://en.wikipedia.org/wiki/Kqueue): macOS, iOS, tvOS, watchOS, FreeBSD, NetBSD, OpenBSD,
- [kqueue](https://en.wikipedia.org/wiki/Kqueue): macOS, iOS, tvOS, watchOS, visionOS, FreeBSD, NetBSD, OpenBSD,
DragonFly BSD
- [event ports](https://illumos.org/man/port_create): illumos, Solaris
- [poll](https://en.wikipedia.org/wiki/Poll_(Unix)): VxWorks, Fuchsia, HermitOS, other Unix systems
Expand Down
15 changes: 3 additions & 12 deletions examples/wait-signal.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#[cfg(all(
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 @@ -43,10 +40,7 @@ mod example {

#[cfg(all(
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 All @@ -60,10 +54,7 @@ fn main() {

#[cfg(not(all(
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
12 changes: 3 additions & 9 deletions src/kqueue.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Bindings to kqueue (macOS, iOS, tvOS, watchOS, FreeBSD, NetBSD, OpenBSD, DragonFly BSD).
//! Bindings to kqueue (macOS, iOS, tvOS, watchOS, visionOS, FreeBSD, NetBSD, OpenBSD, DragonFly BSD).
use std::collections::HashSet;
use std::io;
Expand Down Expand Up @@ -397,10 +397,7 @@ pub(crate) fn mode_to_flags(mode: PollMode) -> kqueue::EventFlags {
#[cfg(any(
target_os = "freebsd",
target_os = "dragonfly",
target_os = "macos",
target_os = "ios",
target_os = "tvos",
target_os = "watchos",
target_vendor = "apple",
))]
mod notify {
use super::Poller;
Expand Down Expand Up @@ -480,10 +477,7 @@ mod notify {
#[cfg(not(any(
target_os = "freebsd",
target_os = "dragonfly",
target_os = "macos",
target_os = "ios",
target_os = "tvos",
target_os = "watchos",
target_vendor = "apple",
)))]
mod notify {
use super::Poller;
Expand Down
17 changes: 4 additions & 13 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! Supported platforms:
//! - [epoll](https://en.wikipedia.org/wiki/Epoll): Linux, Android, RedoxOS
//! - [kqueue](https://en.wikipedia.org/wiki/Kqueue): macOS, iOS, tvOS, watchOS, FreeBSD, NetBSD, OpenBSD,
//! - [kqueue](https://en.wikipedia.org/wiki/Kqueue): macOS, iOS, tvOS, watchOS, visionOS, FreeBSD, NetBSD, OpenBSD,
//! DragonFly BSD
//! - [event ports](https://illumos.org/man/port_create): illumos, Solaris
//! - [poll](https://en.wikipedia.org/wiki/Poll_(Unix)): VxWorks, Fuchsia, HermitOS, other Unix systems
Expand Down Expand Up @@ -94,10 +94,7 @@ cfg_if! {
mod port;
use port as sys;
} 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 Expand Up @@ -968,10 +965,7 @@ impl fmt::Debug for Events {
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 All @@ -986,10 +980,7 @@ impl fmt::Debug for Events {
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/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
#[cfg(all(
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
10 changes: 2 additions & 8 deletions tests/other_modes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,7 @@ fn edge_triggered() {
any(
target_os = "linux",
target_os = "android",
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 @@ -209,10 +206,7 @@ fn edge_oneshot_triggered() {
any(
target_os = "linux",
target_os = "android",
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
10 changes: 2 additions & 8 deletions tests/precision.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ fn below_ms() -> io::Result<()> {
any(
target_os = "linux",
target_os = "android",
target_os = "macos",
target_os = "ios",
target_os = "tvos",
target_os = "watchos",
target_vendor = "apple",
target_os = "freebsd",
),
not(polling_test_poll_backend)
Expand Down Expand Up @@ -64,10 +61,7 @@ fn above_ms() -> io::Result<()> {
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",
),
not(polling_test_poll_backend)
Expand Down

0 comments on commit 7145cd2

Please sign in to comment.