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

visionOS Support #3568

Merged
merged 2 commits into from
Apr 26, 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
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const ALLOWED_CFGS: &'static [&'static str] = &[

// Extra values to allow for check-cfg.
const CHECK_CFG_EXTRA: &'static [(&'static str, &'static [&'static str])] = &[
("target_os", &["switch", "aix", "ohos", "hurd"]),
("target_os", &["switch", "aix", "ohos", "hurd", "visionos"]),
("target_env", &["illumos", "wasi", "aix", "ohos"]),
(
"target_arch",
Expand Down
3 changes: 3 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2538,6 +2538,9 @@ fn test_freebsd(target: &str) {
| "sctp_send_failed_event"
| "sctp_stream_reset_event" => true,

// FIXME: Changed in FreeBSD 15
"tcp_info" | "sockstat" if Some(15) >= freebsd_ver => true,

_ => false,
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6475,7 +6475,7 @@ cfg_if! {
}
}
cfg_if! {
if #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))] {
if #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "visionos"))] {
extern "C" {
pub fn memmem(
haystack: *const ::c_void,
Expand Down
3 changes: 2 additions & 1 deletion src/unix/bsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ s! {
target_os = "ios",
target_os = "tvos",
target_os = "watchos",
target_os = "visionos",
target_os = "netbsd",
target_os = "openbsd")))]
pub pw_fields: ::c_int,
Expand Down Expand Up @@ -917,7 +918,7 @@ extern "C" {
}

cfg_if! {
if #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos"))] {
if #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))] {
mod apple;
pub use self::apple::*;
} else if #[cfg(any(target_os = "openbsd", target_os = "netbsd"))] {
Expand Down
8 changes: 6 additions & 2 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ cfg_if! {
target_os = "ios",
target_os = "tvos",
target_os = "watchos",
target_os = "visionos",
target_os = "android",
target_os = "openbsd",
target_os = "nto",
Expand Down Expand Up @@ -1042,7 +1043,8 @@ extern "C" {
target_os = "macos",
target_os = "ios",
target_os = "tvos",
target_os = "watchos"
target_os = "watchos",
target_os = "visionos"
),
link_name = "realpath$DARWIN_EXTSN"
)]
Expand Down Expand Up @@ -1218,7 +1220,8 @@ extern "C" {
target_os = "macos",
target_os = "ios",
target_os = "tvos",
target_os = "watchos"
target_os = "watchos",
target_os = "visionos"
),
link_name = "res_9_init"
)]
Expand Down Expand Up @@ -1555,6 +1558,7 @@ cfg_if! {
target_os = "ios",
target_os = "tvos",
target_os = "watchos",
target_os = "visionos",
target_os = "freebsd",
target_os = "dragonfly",
target_os = "openbsd",
Expand Down