From fb31f88886a272e6e5b18ea00f2784edf5f94147 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Mon, 4 Mar 2024 17:17:49 +0100 Subject: [PATCH] make ci/style.sh happy --- src/unix/linux_like/android/mod.rs | 4 ++++ src/unix/linux_like/linux/mod.rs | 20 ++++++++++++++++++++ src/unix/linux_like/mod.rs | 30 ------------------------------ 3 files changed, 24 insertions(+), 30 deletions(-) diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index 2c1c1e9b91f27..3160fc84677e4 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -48,6 +48,10 @@ pub type Elf64_Xword = u64; pub type eventfd_t = u64; +// these structs sit behind a heap allocation on Android +pub type posix_spawn_file_actions_t = *mut ::c_void; +pub type posix_spawnattr_t = *mut ::c_void; + s! { pub struct stack_t { pub ss_sp: *mut ::c_void, diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index e8fb33d2c40d6..38a23ca9af0ea 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -722,6 +722,26 @@ s! { pub salt: [::c_uchar; TLS_CIPHER_CHACHA20_POLY1305_SALT_SIZE], pub rec_seq: [::c_uchar; TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE], } + + pub struct posix_spawn_file_actions_t { + __allocated: ::c_int, + __used: ::c_int, + __actions: *mut ::c_int, + __pad: [::c_int; 16], + } + + pub struct posix_spawnattr_t { + __flags: ::c_short, + __pgrp: ::pid_t, + __sd: ::sigset_t, + __ss: ::sigset_t, + #[cfg(any(target_env = "musl", target_env = "ohos"))] + __prio: ::c_int, + #[cfg(not(any(target_env = "musl", target_env = "ohos")))] + __sp: ::sched_param, + __policy: ::c_int, + __pad: [::c_int; 16], + } } s_no_extra_traits! { diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs index 4b52e123aa8ec..9e07d3ae742b1 100644 --- a/src/unix/linux_like/mod.rs +++ b/src/unix/linux_like/mod.rs @@ -6,36 +6,6 @@ pub type timer_t = *mut ::c_void; pub type key_t = ::c_int; pub type id_t = ::c_uint; -cfg_if! { - if #[cfg(target_os = "android")] { - // these structs sit behind a heap allocation on Android - pub type posix_spawn_file_actions_t = *mut ::c_void; - pub type posix_spawnattr_t = *mut ::c_void; - } else if #[cfg(not(target_os = "emscripten"))] { - s! { - pub struct posix_spawn_file_actions_t { - __allocated: ::c_int, - __used: ::c_int, - __actions: *mut ::c_int, - __pad: [::c_int; 16], - } - - pub struct posix_spawnattr_t { - __flags: ::c_short, - __pgrp: ::pid_t, - __sd: ::sigset_t, - __ss: ::sigset_t, - #[cfg(any(target_env = "musl", target_env = "ohos"))] - __prio: ::c_int, - #[cfg(not(any(target_env = "musl", target_env = "ohos")))] - __sp: ::sched_param, - __policy: ::c_int, - __pad: [::c_int; 16], - } - } - } -} - missing! { #[cfg_attr(feature = "extra_traits", derive(Debug))] pub enum timezone {}