Skip to content

Commit 98e5945

Browse files
committed
[watch_os] add support for Apple WatchOS
1 parent 1708299 commit 98e5945

File tree

7 files changed

+44
-6
lines changed

7 files changed

+44
-6
lines changed

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/libc.iml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/unix/bsd/apple/mod.rs

Lines changed: 3 additions & 3 deletions
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(any(target_arch = "arm", target_arch = "x86", target_pointer_width = "32"))]
11761176
pub ifi_lastchange: ::timeval,
1177-
#[cfg(not(any(target_arch = "arm", target_arch = "x86")))]
1177+
#[cfg(not(any(target_arch = "arm", target_arch = "x86", target_pointer_width = "32")))]
11781178
pub ifi_lastchange: timeval32,
11791179
}
11801180

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

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

src/unix/bsd/mod.rs

Lines changed: 2 additions & 1 deletion
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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ cfg_if! {
348348
extern {}
349349
} else if #[cfg(any(target_os = "macos",
350350
target_os = "ios",
351+
target_os = "watchos",
351352
target_os = "android",
352353
target_os = "openbsd"))] {
353354
#[link(name = "c")]
@@ -1017,7 +1018,7 @@ extern "C" {
10171018
pub fn getrusage(resource: ::c_int, usage: *mut rusage) -> ::c_int;
10181019

10191020
#[cfg_attr(
1020-
any(target_os = "macos", target_os = "ios"),
1021+
any(target_os = "macos", target_os = "ios", target_os = "watchos"),
10211022
link_name = "realpath$DARWIN_EXTSN"
10221023
)]
10231024
pub fn realpath(pathname: *const ::c_char, resolved: *mut ::c_char) -> *mut ::c_char;
@@ -1183,7 +1184,7 @@ extern "C" {
11831184
),
11841185
link_name = "__res_init"
11851186
)]
1186-
#[cfg_attr(any(target_os = "macos", target_os = "ios"), link_name = "res_9_init")]
1187+
#[cfg_attr(any(target_os = "macos", target_os = "ios", target_os = "watchos"), link_name = "res_9_init")]
11871188
pub fn res_init() -> ::c_int;
11881189

11891190
#[cfg_attr(target_os = "netbsd", link_name = "__gmtime_r50")]
@@ -1456,6 +1457,7 @@ cfg_if! {
14561457
pub use self::linux_like::*;
14571458
} else if #[cfg(any(target_os = "macos",
14581459
target_os = "ios",
1460+
target_os = "watchos",
14591461
target_os = "freebsd",
14601462
target_os = "dragonfly",
14611463
target_os = "openbsd",

0 commit comments

Comments
 (0)