From a82f231cb385ffb0411faf82f778565702299a47 Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Sun, 25 Aug 2019 14:29:57 +0200 Subject: [PATCH] Docs and formatting --- build.rs | 4 +++- src/unix/bsd/freebsdlike/freebsd/mod.rs | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/build.rs b/build.rs index 93b1882b19a68..d5bcb5253a4c8 100644 --- a/build.rs +++ b/build.rs @@ -22,7 +22,9 @@ fn main() { // On CI, we detect the actual FreeBSD version and match its ABI exactly, // running tests to ensure that the ABI is correct. match which_freebsd() { - Some(10) if libc_ci || rustc_dep_of_std => println!("cargo:rustc-cfg=freebsd10"), + Some(10) if libc_ci || rustc_dep_of_std => { + println!("cargo:rustc-cfg=freebsd10") + } Some(11) if libc_ci => println!("cargo:rustc-cfg=freebsd11"), Some(12) if libc_ci => println!("cargo:rustc-cfg=freebsd12"), Some(13) if libc_ci => println!("cargo:rustc-cfg=freebsd13"), diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 16b625b59ed3f..be4a91739e16b 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -104,6 +104,10 @@ s! { } } +// FIXME: FreeBSD10 is only defined when building libstd +// These types are not available in FreeBSD10 and +// cfg'ing them out prevents them from being used from +// libstd by accident. #[cfg(not(freebsd10))] s! { pub struct mmsghdr { @@ -310,10 +314,12 @@ cfg_if! { } } +// FIXME: FreeBSD10 is only defined when building libstd +// These constants are not available in FreeBSD10 and +// cfg'ing them out prevents them from being used from +// libstd by accident. cfg_if! { if #[cfg(not(freebsd10))] { - // These constants are not available in FreeBSD10 - // This prevents them from being used from libstd: pub const SF_USER_READAHEAD: ::c_int = 0x00000008; pub const SF_NOCACHE: ::c_int = 0x00000010; pub const RLIMIT_KQUEUES: ::c_int = 13; @@ -1143,6 +1149,10 @@ f! { } } +// FIXME: FreeBSD10 is only defined when building libstd +// These functions are not available in FreeBSD10 and +// cfg'ing them out prevents them from being used from +// libstd by accident. #[cfg(not(freebsd10))] extern { pub fn fdatasync(fd: ::c_int) -> ::c_int;