summaryrefslogtreecommitdiff
path: root/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/build.rs b/build.rs
index 61acba646d..47eef2f802 100644
--- a/build.rs
+++ b/build.rs
@@ -60,6 +60,11 @@ fn main() {
println!("cargo:rustc-cfg=libc_align");
}
+ // Rust >= 1.26 supports i128 and u128:
+ if rustc_minor_ver >= 26 || rustc_dep_of_std {
+ println!("cargo:rustc-cfg=libc_int128");
+ }
+
// Rust >= 1.30 supports `core::ffi::c_void`, so libc can just re-export it.
// Otherwise, it defines an incompatible type to retaining
// backwards-compatibility.
@@ -82,6 +87,11 @@ fn main() {
println!("cargo:rustc-cfg=libc_ptr_addr_of");
}
+ // Rust >= 1.57.0 allows assert! (and panics in general) in constants.
+ if rustc_minor_ver >= 57 || rustc_dep_of_std {
+ println!("cargo:rustc-cfg=libc_const_assert");
+ }
+
// #[thread_local] is currently unstable
if rustc_dep_of_std {
println!("cargo:rustc-cfg=libc_thread_local");