summaryrefslogtreecommitdiff
path: root/build.rs
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2022-03-24 11:51:48 +0100
committerest31 <MTest31@outlook.com>2022-03-24 16:02:25 +0100
commite1d9927d539abb5f791ee2a8f374572018bec221 (patch)
tree94be170fcd1b69b01cafc856ac5a04e4cc8e194a /build.rs
parent6a52bb8cdf7f9aba4d6a0e3c2614d9073be1aef9 (diff)
downloadrust-libc-e1d9927d539abb5f791ee2a8f374572018bec221.tar.gz
Use static_assert_eq macro
This macro bases on the static_assert_size macro from the rust compiler. Its advantage is greater compatibility with older rust versions as well as better error messages on a mismatch, as both numbers are printed. The assert macro does not print the mismatching numbers as it only gets the bool from the == comparison.
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/build.rs b/build.rs
index 47eef2f802..bc7b77f25e 100644
--- a/build.rs
+++ b/build.rs
@@ -87,9 +87,9 @@ 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");
+ // Rust >= 1.37.0 allows underscores as anonymous constant names.
+ if rustc_minor_ver >= 37 || rustc_dep_of_std {
+ println!("cargo:rustc-cfg=libc_underscore_const_names");
}
// #[thread_local] is currently unstable