From e1d9927d539abb5f791ee2a8f374572018bec221 Mon Sep 17 00:00:00 2001 From: est31 Date: Thu, 24 Mar 2022 11:51:48 +0100 Subject: 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. --- build.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'build.rs') 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 -- cgit v1.2.1