Skip to content

Commit

Permalink
Update bindgen
Browse files Browse the repository at this point in the history
  • Loading branch information
jbourassa committed Jan 8, 2025
1 parent ed80a48 commit 21cf610
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
16 changes: 4 additions & 12 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions crates/rb-sys-build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ doctest = false
[dependencies]
regex = "1"
shell-words = "1.1"
bindgen = { version = "0.69", default-features = false, features = ["runtime"] }
bindgen = { version = "0.71", default-features = false, features = ["runtime"] }
syn = { version = "2.0", features = ["parsing", "full", "extra-traits"] }
quote = "1.0"
lazy_static = "1.4.0"
proc-macro2 = "1.0"
proc-macro2 = "1.0.92"

[features]
default = []
Expand Down
15 changes: 15 additions & 0 deletions crates/rb-sys-build/src/bindings/stable_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,21 @@ pub fn categorize_bindings(syntax: &mut syn::File) {
}
};
}
} else if let syn::Item::Const(ref mut c) = item {
if c.ident == syn::Ident::new("_", c.ident.span()) {
let body = &mut c.expr;
let code = body.clone().to_token_stream().to_string();
let new_code = code.replace("rb_sys__Opaque__", "");
let new_code = syn::parse_str::<syn::Expr>(&new_code).unwrap();

*body = syn::parse_quote! {
{
#[allow(unused_imports)]
use crate::internal::*;
#new_code
}
};
}
}

normal_items.push(item.clone());
Expand Down

0 comments on commit 21cf610

Please sign in to comment.