Add Linux test
This commit is contained in:
parent
457d654396
commit
b0ba2de767
5
build.rs
5
build.rs
@ -7,6 +7,7 @@ fn main() {
|
|||||||
rustc_minor_version().expect("Failed to get rustc version");
|
rustc_minor_version().expect("Failed to get rustc version");
|
||||||
let rustc_dep_of_std = env::var("CARGO_FEATURE_RUSTC_DEP_OF_STD").is_ok();
|
let rustc_dep_of_std = env::var("CARGO_FEATURE_RUSTC_DEP_OF_STD").is_ok();
|
||||||
let align_cargo_feature = env::var("CARGO_FEATURE_ALIGN").is_ok();
|
let align_cargo_feature = env::var("CARGO_FEATURE_ALIGN").is_ok();
|
||||||
|
let const_extern_fn_cargo_feature = env::var("CARGO_FEATURE_CONST_EXTERN_FN").is_ok();
|
||||||
let libc_ci = env::var("LIBC_CI").is_ok();
|
let libc_ci = env::var("LIBC_CI").is_ok();
|
||||||
|
|
||||||
if env::var("CARGO_FEATURE_USE_STD").is_ok() {
|
if env::var("CARGO_FEATURE_USE_STD").is_ok() {
|
||||||
@ -72,6 +73,10 @@ fn main() {
|
|||||||
if rustc_dep_of_std {
|
if rustc_dep_of_std {
|
||||||
println!("cargo:rustc-cfg=libc_thread_local");
|
println!("cargo:rustc-cfg=libc_thread_local");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if const_extern_fn_cargo_feature {
|
||||||
|
println!("cargo:rustc-cfg=libc_const_extern_fn");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn rustc_minor_version() -> Option<u32> {
|
fn rustc_minor_version() -> Option<u32> {
|
||||||
|
5
tests/const_fn.rs
Normal file
5
tests/const_fn.rs
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#![cfg(libc_const_extern_fn)] // If this does not hold, the file is empty
|
||||||
|
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
const _FOO: libc::c_uint = unsafe { libc::CMSG_SPACE(1) };
|
||||||
|
//^ if CMSG_SPACE is not const, this will fail to compile
|
Loading…
Reference in New Issue
Block a user