From ef24de24a82fe681581cc130f342363c47c0969a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 7 Jun 2024 07:48:48 +0200 Subject: Merging upstream version 1.75.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/libc/build.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'vendor/libc/build.rs') diff --git a/vendor/libc/build.rs b/vendor/libc/build.rs index 787b8b86a..d7a9b7f78 100644 --- a/vendor/libc/build.rs +++ b/vendor/libc/build.rs @@ -33,7 +33,7 @@ const ALLOWED_CFGS: &'static [&'static str] = &[ // Extra values to allow for check-cfg. const CHECK_CFG_EXTRA: &'static [(&'static str, &'static [&'static str])] = &[ - ("target_os", &["switch", "aix", "ohos"]), + ("target_os", &["switch", "aix", "ohos", "hurd"]), ("target_env", &["illumos", "wasi", "aix", "ohos"]), ( "target_arch", @@ -167,11 +167,19 @@ fn main() { // https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg if libc_check_cfg { for cfg in ALLOWED_CFGS { - println!("cargo:rustc-check-cfg=values({})", cfg); + if rustc_minor_ver >= 75 { + println!("cargo:rustc-check-cfg=cfg({})", cfg); + } else { + println!("cargo:rustc-check-cfg=values({})", cfg); + } } for &(name, values) in CHECK_CFG_EXTRA { let values = values.join("\",\""); - println!("cargo:rustc-check-cfg=values({},\"{}\")", name, values); + if rustc_minor_ver >= 75 { + println!("cargo:rustc-check-cfg=cfg({},values(\"{}\"))", name, values); + } else { + println!("cargo:rustc-check-cfg=values({},\"{}\")", name, values); + } } } } -- cgit v1.2.3