diff --git a/build.rs b/build.rs index ec932007ae69f..40d4140e8f65e 100644 --- a/build.rs +++ b/build.rs @@ -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", diff --git a/libc-test/build.rs b/libc-test/build.rs index a156c2694e7c4..ee211ebbf227f 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -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, } }); diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 2e7827231e65f..d53282402667b 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -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, diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index 9a2e6c463d36b..6ee2a3de44035 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, @@ -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"))] { diff --git a/src/unix/mod.rs b/src/unix/mod.rs index 3dca83305ad59..816bcae86ff3e 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", @@ -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" )] @@ -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" )] @@ -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",