summaryrefslogtreecommitdiff
path: root/build.rs
diff options
context:
space:
mode:
authorAria Beingessner <a.beingessner@gmail.com>2022-03-09 01:42:43 -0500
committerAria Beingessner <a.beingessner@gmail.com>2022-03-23 18:21:00 -0400
commitadfa38507c1aa4adce7010a58825af35a1f5fb99 (patch)
tree690ae45788aa6aec9385d9c1015d73cb87cb775d /build.rs
parent1708299c6b49e9fb7e7c34b9edd37c77e7af003c (diff)
downloadrust-libc-adfa38507c1aa4adce7010a58825af35a1f5fb99.tar.gz
Create optionally-available __int128 typedefs and use them for ARM64 definitions.
This adds the following types to fixed_width_ints behind appropriate platform cfgs: * __int128 * __int128_t * __uint128 * __uint128_t and user_fpsimd_struct to arm64 android and linux.
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");