diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:06:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:06:31 +0000 |
commit | 2ff14448863ac1a1dd9533461708e29aae170c2d (patch) | |
tree | 85b9fea2bbfe3f06473cfa381eed11f273b57c5c /vendor/libc/build.rs | |
parent | Adding debian version 1.64.0+dfsg1-1. (diff) | |
download | rustc-2ff14448863ac1a1dd9533461708e29aae170c2d.tar.xz rustc-2ff14448863ac1a1dd9533461708e29aae170c2d.zip |
Adding debian version 1.65.0+dfsg1-2.debian/1.65.0+dfsg1-2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/libc/build.rs')
-rw-r--r-- | vendor/libc/build.rs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/vendor/libc/build.rs b/vendor/libc/build.rs index bc7b77f25..0a43b2a12 100644 --- a/vendor/libc/build.rs +++ b/vendor/libc/build.rs @@ -97,11 +97,18 @@ fn main() { println!("cargo:rustc-cfg=libc_thread_local"); } - if const_extern_fn_cargo_feature { - if !is_nightly || rustc_minor_ver < 40 { - panic!("const-extern-fn requires a nightly compiler >= 1.40") - } + // Rust >= 1.62.0 allows to use `const_extern_fn` for "Rust" and "C". + if rustc_minor_ver >= 62 { println!("cargo:rustc-cfg=libc_const_extern_fn"); + } else { + // Rust < 1.62.0 requires a crate feature and feature gate. + if const_extern_fn_cargo_feature { + if !is_nightly || rustc_minor_ver < 40 { + panic!("const-extern-fn requires a nightly compiler >= 1.40"); + } + println!("cargo:rustc-cfg=libc_const_extern_fn_unstable"); + println!("cargo:rustc-cfg=libc_const_extern_fn"); + } } } |