Skip to content

Commit

Permalink
Auto merge of #2717 - vladimir-ea:watchos, r=Amanieu
Browse files Browse the repository at this point in the history
Add support for Apple WatchOS

Hi, I am hoping to add Apple WatchOS compile targets and these are prerequisite changes.

Many thanks!
Vlad.
  • Loading branch information
bors committed Mar 17, 2022
2 parents ea3ab53 + 68c988f commit f0f4b68
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/unix/bsd/apple/mod.rs
Expand Up @@ -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,
}

Expand Down Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion src/unix/bsd/mod.rs
Expand Up @@ -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,
Expand Down Expand Up @@ -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"))] {
Expand Down
9 changes: 7 additions & 2 deletions src/unix/mod.rs
Expand Up @@ -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")]
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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")]
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit f0f4b68

Please sign in to comment.