summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-03-17 21:56:39 +0000
committerbors <bors@rust-lang.org>2022-03-17 21:56:39 +0000
commitf0f4b689906862bf74297042022c20ada7274b71 (patch)
tree3ed585f0ed1bf3ac48bcadcf7719d3f79677df27
parentea3ab532349796a84f751e4363b04c73ea762a51 (diff)
parent68c988ff64041b3a431d50e41d9dd1bab972b945 (diff)
downloadrust-libc-f0f4b689906862bf74297042022c20ada7274b71.tar.gz
Auto merge of #2717 - vladimir-ea:watchos, r=Amanieu
Add support for Apple WatchOS Hi, I am hoping to add Apple WatchOS compile targets and these are prerequisite changes. Many thanks! Vlad.
-rw-r--r--src/unix/bsd/apple/mod.rs8
-rw-r--r--src/unix/bsd/mod.rs3
-rw-r--r--src/unix/mod.rs9
3 files changed, 13 insertions, 7 deletions
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index 5d10a0032b..4133c2b504 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 a0729ee545..8ebca09301 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 3664607253..cb03b50d75 100644
--- a/src/unix/mod.rs
+++ b/src/unix/mod.rs
@@ -356,6 +356,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")]
@@ -1025,7 +1026,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;
@@ -1191,7 +1192,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")]
@@ -1464,6 +1468,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",