diff options
author | est31 <MTest31@outlook.com> | 2022-03-24 11:51:48 +0100 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2022-03-24 16:02:25 +0100 |
commit | e1d9927d539abb5f791ee2a8f374572018bec221 (patch) | |
tree | 94be170fcd1b69b01cafc856ac5a04e4cc8e194a /build.rs | |
parent | 6a52bb8cdf7f9aba4d6a0e3c2614d9073be1aef9 (diff) | |
download | rust-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.rs | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 |