diff options
author | Daniil Bondarev <xonatius@gmail.com> | 2020-09-12 23:15:38 -0700 |
---|---|---|
committer | Daniil Bondarev <xonatius@gmail.com> | 2020-09-12 23:38:06 -0700 |
commit | 773f5562ba04ad8b7ba772e99645922ea908be76 (patch) | |
tree | 3a7ce4ee9cdf67822733c196f78a04f5959e15fc /src/unix/bsd/freebsdlike/mod.rs | |
parent | c2a184b255c2d7548e17b66f19f0330192ce6484 (diff) | |
download | rust-libc-773f5562ba04ad8b7ba772e99645922ea908be76.tar.gz |
Use safe_f! consistently across platforms
The pr #1870 introduced safe_f! macro, which made some functions like
WIFEXITED and WEXITSTATUS const and safe on linux_like platform only,
which causes inconsistency when trying to use those functions in crates
compiled across multiple platforms, as using unsafe on those functions
will generate unused_unsafe warning on linux platforms and lack of
unsafe block will fail compilation on non-linux platforms.
To avoid the inconsistency, this commit applies the same macro for all
the same functions on other platforms too.
Diffstat (limited to 'src/unix/bsd/freebsdlike/mod.rs')
-rw-r--r-- | src/unix/bsd/freebsdlike/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index f70b8a5e6e..7bf9399d97 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -1220,16 +1220,16 @@ pub const TIME_ERROR: ::c_int = 5; pub const REG_ENOSYS: ::c_int = -1; pub const REG_ILLSEQ: ::c_int = 17; -f! { - pub fn WIFCONTINUED(status: ::c_int) -> bool { +safe_f! { + pub {const} fn WIFCONTINUED(status: ::c_int) -> bool { status == 0x13 } - pub fn WSTOPSIG(status: ::c_int) -> ::c_int { + pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int { status >> 8 } - pub fn WIFSTOPPED(status: ::c_int) -> bool { + pub {const} fn WIFSTOPPED(status: ::c_int) -> bool { (status & 0o177) == 0o177 } } |