Skip to content

Commit

Permalink
Require rust >= 1.15 and drop libc_priv_mod_use conditional
Browse files Browse the repository at this point in the history
[ adjust build.rs changes to match current configuration - Trevor ]
  • Loading branch information
joshtriplett authored and tgross35 committed Nov 16, 2024
1 parent 01ce562 commit 19c5937
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 53 deletions.
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

0 comments on commit 19c5937

Please sign in to comment.