diff --git a/build.rs b/build.rs index 562025dfdc7ab..3ce6995e7092f 100644 --- a/build.rs +++ b/build.rs @@ -21,7 +21,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", diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 5cad5d320e472..6b670b927168e 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -6242,7 +6242,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, diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index e2b5121b03911..229060f066b66 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -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, @@ -924,7 +925,7 @@ cfg_if! { } 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"))] { diff --git a/src/unix/mod.rs b/src/unix/mod.rs index 0b270c0a39bca..ac4ba0f0c9cb3 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -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", @@ -1018,7 +1019,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" )] @@ -1186,7 +1188,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" )] @@ -1523,6 +1526,7 @@ cfg_if! { target_os = "ios", target_os = "tvos", target_os = "watchos", + target_os = "visionos", target_os = "freebsd", target_os = "dragonfly", target_os = "openbsd",