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 .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-4.0.0-preview2
ruby-4.0.0
18 changes: 6 additions & 12 deletions crates/rb-sys-build/src/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,11 @@ fn clean_docs(rbconfig: &RbConfig, syntax: &mut syn::File) {
}

fn default_bindgen(clang_args: Vec<String>, rbconfig: &RbConfig) -> bindgen::Builder {
// Disable layout tests and Debug impl for Ruby 2.7 and 3.0 on Windows MinGW due to type incompatibilities
let is_old_ruby_windows_mingw = if cfg!(target_os = "windows") && !is_msvc() {
if let Some((major, minor)) = rbconfig.major_minor() {
(major == 2 && minor == 7) || (major == 3 && minor == 0)
} else {
false
}
} else {
false
};
// Disable layout tests and Debug impl on Windows MinGW due to packed struct layout incompatibilities
let is_windows_mingw = cfg!(target_os = "windows") && !is_msvc();

let enable_layout_tests = !is_old_ruby_windows_mingw && cfg!(feature = "bindgen-layout-tests");
let impl_debug = !is_old_ruby_windows_mingw && cfg!(feature = "bindgen-impl-debug");
let enable_layout_tests = !is_windows_mingw && cfg!(feature = "bindgen-layout-tests");
let impl_debug = !is_windows_mingw && cfg!(feature = "bindgen-impl-debug");

let mut bindings = bindgen::Builder::default()
.rustified_enum(".*")
Expand All @@ -167,6 +159,8 @@ fn default_bindgen(clang_args: Vec<String>, rbconfig: &RbConfig) -> bindgen::Bui
.blocklist_item("^__pthread_.*")
.blocklist_item("^pthread_.*")
.blocklist_item("^rb_native.*")
.blocklist_type("INET_PORT_RESERVATION_INSTANCE")
.blocklist_type("PINET_PORT_RESERVATION_INSTANCE")
.opaque_type("^__sFILE$")
.merge_extern_blocks(true)
.generate_comments(true)
Expand Down
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading