Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ serde_json = "1"
# Related to tooling/build setup.
# * regex: not used for unicode parsing -> features unicode-bool + unicode-gencat are enabled instead of unicode-perl.
# 'unicode-gencat' needed for \d, see https://docs.rs/regex/latest/regex/#unicode-features.
bindgen = { version = "0.71", default-features = false, features = ["runtime"] }
bindgen = { version = "0.72.1", default-features = false, features = ["runtime"] }
libc = "0.2.172"
regex = { version = "1.11", default-features = false, features = ["std", "unicode-bool", "unicode-gencat"] }
which = "7"
Expand Down
8 changes: 7 additions & 1 deletion godot-bindings/src/header_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ pub(crate) fn generate_rust_binding(in_h_path: &Path, out_rs_path: &Path) {
let builder = bindgen::Builder::default()
.header(c_header_path)
.parse_callbacks(Box::new(cargo_cfg))
.prepend_enum_name(false);
.prepend_enum_name(false)
// Bindgen can generate wrong size checks for types defined as `__attribute__((aligned(__alignof__(struct {...}))))`,
// which is how clang defines max_align_t: https://clang.llvm.org/doxygen/____stddef__max__align__t_8h_source.html.
// Size checks seems to be fine on all the targets but `wasm32-unknown-emscripten`, disallowing web builds.
// We don't use `max_align_t` anywhere, so blacklisting it until upstream fixes the problem seems to be the most sane solution.
// See: https://github.com/rust-lang/rust-bindgen/issues/3295.
.blocklist_type("max_align_t");

std::fs::create_dir_all(
out_rs_path
Expand Down
Loading