Skip to content

Commit 89aa05e

Browse files
authored
refactor: cfg for ioctl/* & ptrace/* (#2222)
1 parent fefed8e commit 89aa05e

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

src/sys/ioctl/mod.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,11 @@
227227
//! ```
228228
use cfg_if::cfg_if;
229229

230-
#[cfg(any(target_os = "android", target_os = "linux", target_os = "redox"))]
230+
#[cfg(any(linux_android, target_os = "redox"))]
231231
#[macro_use]
232232
mod linux;
233233

234-
#[cfg(any(
235-
target_os = "android",
236-
target_os = "linux",
237-
target_os = "redox"
238-
))]
234+
#[cfg(any(linux_android, target_os = "redox"))]
239235
pub use self::linux::*;
240236

241237
#[cfg(any(bsd, target_os = "illumos", target_os = "haiku",))]

src/sys/ptrace/bsd.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ use std::ptr;
99
pub type RequestType = c_int;
1010

1111
cfg_if! {
12-
if #[cfg(any(target_os = "dragonfly",
13-
target_os = "freebsd",
14-
target_os = "macos",
15-
target_os = "openbsd"))] {
12+
if #[cfg(any(freebsdlike, target_os = "macos", target_os = "openbsd"))] {
1613
#[doc(hidden)]
1714
pub type AddressType = *mut ::libc::c_char;
1815
} else {
@@ -37,9 +34,7 @@ libc_enum! {
3734
PT_WRITE_U,
3835
PT_CONTINUE,
3936
PT_KILL,
40-
#[cfg(any(any(target_os = "dragonfly",
41-
target_os = "freebsd",
42-
target_os = "macos"),
37+
#[cfg(any(any(freebsdlike, target_os = "macos"),
4338
all(target_os = "openbsd", target_arch = "x86_64"),
4439
all(target_os = "netbsd", any(target_arch = "x86_64",
4540
target_arch = "powerpc"))))]

src/sys/ptrace/mod.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,15 @@ mod linux;
77
pub use self::linux::*;
88

99
#[cfg(any(
10-
target_os = "dragonfly",
11-
target_os = "freebsd",
10+
freebsdlike,
1211
target_os = "macos",
1312
target_os = "netbsd",
1413
target_os = "openbsd"
1514
))]
1615
mod bsd;
1716

1817
#[cfg(any(
19-
target_os = "dragonfly",
20-
target_os = "freebsd",
18+
freebsdlike,
2119
target_os = "macos",
2220
target_os = "netbsd",
2321
target_os = "openbsd"

0 commit comments

Comments
 (0)