Skip to content

Commit f0f4b68

Browse files
committed
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.
2 parents ea3ab53 + 68c988f commit f0f4b68

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

src/unix/bsd/apple/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1172,9 +1172,9 @@ s_no_extra_traits! {
11721172
pub ifi_noproto: u64,
11731173
pub ifi_recvtiming: u32,
11741174
pub ifi_xmittiming: u32,
1175-
#[cfg(any(target_arch = "arm", target_arch = "x86"))]
1175+
#[cfg(target_pointer_width = "32")]
11761176
pub ifi_lastchange: ::timeval,
1177-
#[cfg(not(any(target_arch = "arm", target_arch = "x86")))]
1177+
#[cfg(not(target_pointer_width = "32"))]
11781178
pub ifi_lastchange: timeval32,
11791179
}
11801180

@@ -5522,10 +5522,10 @@ extern "C" {
55225522
}
55235523

55245524
cfg_if! {
5525-
if #[cfg(any(target_arch = "arm", target_arch = "x86"))] {
5525+
if #[cfg(target_pointer_width = "32")] {
55265526
mod b32;
55275527
pub use self::b32::*;
5528-
} else if #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] {
5528+
} else if #[cfg(target_pointer_width = "64")] {
55295529
mod b64;
55305530
pub use self::b64::*;
55315531
} else {

src/unix/bsd/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ s! {
3737

3838
#[cfg(not(any(target_os = "macos",
3939
target_os = "ios",
40+
target_os = "watchos",
4041
target_os = "netbsd",
4142
target_os = "openbsd")))]
4243
pub pw_fields: ::c_int,
@@ -880,7 +881,7 @@ extern "C" {
880881
}
881882

882883
cfg_if! {
883-
if #[cfg(any(target_os = "macos", target_os = "ios"))] {
884+
if #[cfg(any(target_os = "macos", target_os = "ios", target_os = "watchos"))] {
884885
mod apple;
885886
pub use self::apple::*;
886887
} else if #[cfg(any(target_os = "openbsd", target_os = "netbsd"))] {

src/unix/mod.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ cfg_if! {
356356
extern {}
357357
} else if #[cfg(any(target_os = "macos",
358358
target_os = "ios",
359+
target_os = "watchos",
359360
target_os = "android",
360361
target_os = "openbsd"))] {
361362
#[link(name = "c")]
@@ -1025,7 +1026,7 @@ extern "C" {
10251026
pub fn getrusage(resource: ::c_int, usage: *mut rusage) -> ::c_int;
10261027

10271028
#[cfg_attr(
1028-
any(target_os = "macos", target_os = "ios"),
1029+
any(target_os = "macos", target_os = "ios", target_os = "watchos"),
10291030
link_name = "realpath$DARWIN_EXTSN"
10301031
)]
10311032
pub fn realpath(pathname: *const ::c_char, resolved: *mut ::c_char) -> *mut ::c_char;
@@ -1191,7 +1192,10 @@ extern "C" {
11911192
),
11921193
link_name = "__res_init"
11931194
)]
1194-
#[cfg_attr(any(target_os = "macos", target_os = "ios"), link_name = "res_9_init")]
1195+
#[cfg_attr(
1196+
any(target_os = "macos", target_os = "ios", target_os = "watchos"),
1197+
link_name = "res_9_init"
1198+
)]
11951199
pub fn res_init() -> ::c_int;
11961200

11971201
#[cfg_attr(target_os = "netbsd", link_name = "__gmtime_r50")]
@@ -1464,6 +1468,7 @@ cfg_if! {
14641468
pub use self::linux_like::*;
14651469
} else if #[cfg(any(target_os = "macos",
14661470
target_os = "ios",
1471+
target_os = "watchos",
14671472
target_os = "freebsd",
14681473
target_os = "dragonfly",
14691474
target_os = "openbsd",

0 commit comments

Comments
 (0)