Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const ALLOWED_CFGS: &'static [&'static str] = &[
"libc_long_array",
"libc_non_exhaustive",
"libc_packedN",
"libc_priv_mod_use",
"libc_ptr_addr_of",
"libc_thread_local",
"libc_underscore_const_names",
Expand Down Expand Up @@ -99,11 +98,6 @@ fn main() {
set_cfg("libc_deny_warnings");
}

// Rust >= 1.15 supports private module use:
if rustc_minor_ver >= 15 || rustc_dep_of_std {
set_cfg("libc_priv_mod_use");
}

// Rust >= 1.19 supports unions:
if rustc_minor_ver >= 19 || rustc_dep_of_std {
set_cfg("libc_union");
Expand Down
1 change: 0 additions & 1 deletion libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ fn do_ctest() {
fn ctest_cfg() -> ctest::TestGenerator {
let mut cfg = ctest::TestGenerator::new();
let libc_cfgs = [
"libc_priv_mod_use",
"libc_union",
"libc_const_size_of",
"libc_align",
Expand Down
66 changes: 20 additions & 46 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,52 +43,26 @@ cfg_if! {
}
}

cfg_if! {
if #[cfg(libc_priv_mod_use)] {
#[cfg(libc_core_cvoid)]
#[allow(unused_imports)]
use core::ffi;
#[allow(unused_imports)]
use core::fmt;
#[allow(unused_imports)]
use core::hash;
#[allow(unused_imports)]
use core::num;
#[allow(unused_imports)]
use core::mem;
#[doc(hidden)]
#[allow(unused_imports)]
use core::clone::Clone;
#[doc(hidden)]
#[allow(unused_imports)]
use core::marker::{Copy, Send, Sync};
#[doc(hidden)]
#[allow(unused_imports)]
use core::option::Option;
} else {
#[doc(hidden)]
#[allow(unused_imports)]
pub use core::fmt;
#[doc(hidden)]
#[allow(unused_imports)]
pub use core::hash;
#[doc(hidden)]
#[allow(unused_imports)]
pub use core::num;
#[doc(hidden)]
#[allow(unused_imports)]
pub use core::mem;
#[doc(hidden)]
#[allow(unused_imports)]
pub use core::clone::Clone;
#[doc(hidden)]
#[allow(unused_imports)]
pub use core::marker::{Copy, Send, Sync};
#[doc(hidden)]
#[allow(unused_imports)]
pub use core::option::Option;
}
}
#[doc(hidden)]
#[allow(unused_imports)]
use core::clone::Clone;
#[cfg(libc_core_cvoid)]
#[allow(unused_imports)]
use core::ffi;
#[allow(unused_imports)]
use core::fmt;
#[allow(unused_imports)]
use core::hash;
#[doc(hidden)]
#[allow(unused_imports)]
use core::marker::{Copy, Send, Sync};
#[allow(unused_imports)]
use core::mem;
#[allow(unused_imports)]
use core::num;
#[doc(hidden)]
#[allow(unused_imports)]
use core::option::Option;

cfg_if! {
if #[cfg(windows)] {
Expand Down