Skip to content

Commit 4f22eb8

Browse files
committed
wip
1 parent 4cebd24 commit 4f22eb8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const ALLOWED_CFGS: &'static [&'static str] = &[
1313
"freebsd13",
1414
"freebsd14",
1515
"freebsd15",
16+
"libc_const_extern_fn",
1617
"libc_deny_warnings",
1718
"libc_ctest",
1819
];
@@ -74,6 +75,8 @@ fn main() {
7475
set_cfg("libc_deny_warnings");
7576
}
7677

78+
set_cfg("libc_const_extern_fn");
79+
7780
// check-cfg is a nightly cargo/rustc feature to warn when unknown cfgs are used across the
7881
// codebase. libc can configure it if the appropriate environment variable is passed. Since
7982
// rust-lang/rust enforces it, this is useful when using a custom libc fork there.

src/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ macro_rules! e {
199199
// cfg completely.
200200
// FIXME(ctest): ctest can't handle `$(,)?` so we use `$(,)*` which isn't quite correct.
201201
cfg_if! {
202-
if #[cfg(all())] {
202+
if #[cfg(libc_const_extern_fn)] {
203203
// if #[cfg(feature = "const-extern-fn")] {
204204
/// Define an `unsafe` function that is const as long as `const-extern-fn` is enabled.
205205
macro_rules! f {

0 commit comments

Comments
 (0)