diff options
author | Amanieu d'Antras <amanieu@gmail.com> | 2022-11-10 00:34:58 +0000 |
---|---|---|
committer | Amanieu d'Antras <amanieu@gmail.com> | 2023-03-04 22:17:21 +0000 |
commit | 3f5128e77a04257a661335e9582a7f1b1e56d118 (patch) | |
tree | 06165a9b962e4144b3bee91dd040562ba6f694da /src/unix/mod.rs | |
parent | 973c3e1fb8acd198f197fa2a25d99184fa1f5f4b (diff) | |
download | rust-libc-3f5128e77a04257a661335e9582a7f1b1e56d118.tar.gz |
Add support for OpenHarmony
Diffstat (limited to 'src/unix/mod.rs')
-rw-r--r-- | src/unix/mod.rs | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/unix/mod.rs b/src/unix/mod.rs index 49c2d5717a..b005970b9d 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -130,7 +130,7 @@ s! { #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] __pad14: u32, - #[cfg(any(target_env = "musl", target_os = "emscripten"))] + #[cfg(any(target_env = "musl", target_env = "ohos", target_os = "emscripten"))] __reserved: [c_long; 16], } @@ -351,7 +351,7 @@ cfg_if! { #[link(name = "dl", cfg(not(target_feature = "crt-static")))] #[link(name = "c", cfg(not(target_feature = "crt-static")))] extern {} - } else if #[cfg(target_env = "musl")] { + } else if #[cfg(any(target_env = "musl", target_env = "ohos"))] { #[cfg_attr(feature = "rustc-dep-of-std", link(name = "c", kind = "static", modifiers = "-bundle", cfg(target_feature = "crt-static")))] @@ -1217,7 +1217,10 @@ extern "C" { pub fn gai_strerror(errcode: ::c_int) -> *const ::c_char; #[cfg_attr( any( - all(target_os = "linux", not(target_env = "musl")), + all( + target_os = "linux", + not(any(target_env = "musl", target_env = "ohos")) + ), target_os = "freebsd", target_os = "dragonfly", target_os = "haiku" @@ -1236,11 +1239,11 @@ extern "C" { pub fn res_init() -> ::c_int; #[cfg_attr(target_os = "netbsd", link_name = "__gmtime_r50")] - #[cfg_attr(target_env = "musl", allow(deprecated))] + #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] // FIXME: for `time_t` pub fn gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm; #[cfg_attr(target_os = "netbsd", link_name = "__localtime_r50")] - #[cfg_attr(target_env = "musl", allow(deprecated))] + #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] // FIXME: for `time_t` pub fn localtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm; #[cfg_attr( @@ -1248,27 +1251,27 @@ extern "C" { link_name = "mktime$UNIX2003" )] #[cfg_attr(target_os = "netbsd", link_name = "__mktime50")] - #[cfg_attr(target_env = "musl", allow(deprecated))] + #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] // FIXME: for `time_t` pub fn mktime(tm: *mut tm) -> time_t; #[cfg_attr(target_os = "netbsd", link_name = "__time50")] - #[cfg_attr(target_env = "musl", allow(deprecated))] + #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] // FIXME: for `time_t` pub fn time(time: *mut time_t) -> time_t; #[cfg_attr(target_os = "netbsd", link_name = "__gmtime50")] - #[cfg_attr(target_env = "musl", allow(deprecated))] + #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] // FIXME: for `time_t` pub fn gmtime(time_p: *const time_t) -> *mut tm; #[cfg_attr(target_os = "netbsd", link_name = "__locatime50")] - #[cfg_attr(target_env = "musl", allow(deprecated))] + #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] // FIXME: for `time_t` pub fn localtime(time_p: *const time_t) -> *mut tm; #[cfg_attr(target_os = "netbsd", link_name = "__difftime50")] - #[cfg_attr(target_env = "musl", allow(deprecated))] + #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] // FIXME: for `time_t` pub fn difftime(time1: time_t, time0: time_t) -> ::c_double; #[cfg_attr(target_os = "netbsd", link_name = "__timegm50")] - #[cfg_attr(target_env = "musl", allow(deprecated))] + #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] // FIXME: for `time_t` pub fn timegm(tm: *mut ::tm) -> time_t; |