diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 5d10a0032b7f..4133c2b504e1 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -1172,9 +1172,9 @@ s_no_extra_traits! { pub ifi_noproto: u64, pub ifi_recvtiming: u32, pub ifi_xmittiming: u32, - #[cfg(any(target_arch = "arm", target_arch = "x86"))] + #[cfg(target_pointer_width = "32")] pub ifi_lastchange: ::timeval, - #[cfg(not(any(target_arch = "arm", target_arch = "x86")))] + #[cfg(not(target_pointer_width = "32"))] pub ifi_lastchange: timeval32, } @@ -5522,10 +5522,10 @@ extern "C" { } cfg_if! { - if #[cfg(any(target_arch = "arm", target_arch = "x86"))] { + if #[cfg(target_pointer_width = "32")] { mod b32; pub use self::b32::*; - } else if #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] { + } else if #[cfg(target_pointer_width = "64")] { mod b64; pub use self::b64::*; } else { diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index a0729ee545d8..8ebca0930107 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -37,6 +37,7 @@ s! { #[cfg(not(any(target_os = "macos", target_os = "ios", + target_os = "watchos", target_os = "netbsd", target_os = "openbsd")))] pub pw_fields: ::c_int, @@ -880,7 +881,7 @@ extern "C" { } cfg_if! { - if #[cfg(any(target_os = "macos", target_os = "ios"))] { + if #[cfg(any(target_os = "macos", target_os = "ios", target_os = "watchos"))] { 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 5ff2294e797c..adc72f0ff50c 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -348,6 +348,7 @@ cfg_if! { extern {} } else if #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "watchos", target_os = "android", target_os = "openbsd"))] { #[link(name = "c")] @@ -1017,7 +1018,7 @@ extern "C" { pub fn getrusage(resource: ::c_int, usage: *mut rusage) -> ::c_int; #[cfg_attr( - any(target_os = "macos", target_os = "ios"), + any(target_os = "macos", target_os = "ios", target_os = "watchos"), link_name = "realpath$DARWIN_EXTSN" )] pub fn realpath(pathname: *const ::c_char, resolved: *mut ::c_char) -> *mut ::c_char; @@ -1183,7 +1184,10 @@ extern "C" { ), link_name = "__res_init" )] - #[cfg_attr(any(target_os = "macos", target_os = "ios"), link_name = "res_9_init")] + #[cfg_attr( + any(target_os = "macos", target_os = "ios", target_os = "watchos"), + link_name = "res_9_init" + )] pub fn res_init() -> ::c_int; #[cfg_attr(target_os = "netbsd", link_name = "__gmtime_r50")] @@ -1456,6 +1460,7 @@ cfg_if! { pub use self::linux_like::*; } else if #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "watchos", target_os = "freebsd", target_os = "dragonfly", target_os = "openbsd",