Skip to content

Commit 09f41e8

Browse files
committed
what if...
1 parent 5e10f6a commit 09f41e8

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Modules/cpython-sys/build.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ fn generate_c_api_bindings(srcdir: &Path, builddir: Option<&str>, out_path: &Pat
6363
// Suppress all clang warnings (deprecation warnings, etc.)
6464
builder = builder.clang_arg("-w");
6565

66-
// Use C11 with GNU extensions so that <stdatomic.h> is available,
67-
// required by the mimalloc headers.
68-
builder = builder.clang_arg("-std=gnu11");
69-
7066
// Tell clang the correct target triple for cross-compilation when we have
7167
// an LLVM-specific triple. Otherwise let bindgen translate Cargo's TARGET
7268
// itself (e.g. aarch64-apple-ios-sim -> arm64-apple-ios-simulator).
@@ -155,6 +151,11 @@ fn generate_c_api_bindings(srcdir: &Path, builddir: Option<&str>, out_path: &Pat
155151
}
156152
builder = add_target_clang_args(builder, builddir);
157153

154+
// Use C11 with GNU extensions so that <stdatomic.h> is available,
155+
// required by the mimalloc headers. This must be the last clang arg
156+
// to ensure it is not overridden by any earlier -std= flag.
157+
builder = builder.clang_arg("-std=gnu11");
158+
158159
let bindings = builder
159160
.allowlist_function("_?Py.*")
160161
.allowlist_type("_?Py.*")

0 commit comments

Comments
 (0)