From 01eddda7ed462ba3b6eea87e2f993823a75292ef Mon Sep 17 00:00:00 2001 From: Reinis M Date: Fri, 26 Dec 2025 16:50:29 +0200 Subject: [PATCH 1/2] Remove OleAut32.lib --- c/src/win32.c | 1 - 1 file changed, 1 deletion(-) diff --git a/c/src/win32.c b/c/src/win32.c index c92afbb..86b0bf1 100644 --- a/c/src/win32.c +++ b/c/src/win32.c @@ -9,7 +9,6 @@ #include #pragma comment(lib, "User32.lib") -#pragma comment(lib, "OleAut32.lib") #ifndef WC_ERR_INVALID_CHARS #define WC_ERR_INVALID_CHARS 0x80 From 43c11ccda15db94d1ebf056c3d92f3be5d8d2c18 Mon Sep 17 00:00:00 2001 From: reinis Date: Tue, 19 May 2026 13:37:03 +0300 Subject: [PATCH 2/2] Bump bindgen to 0.72 and let it parse real impl headers Bindgen 0.69's libclang behavior on macOS produced opaque structs (just _address: u8) for bw_Application, bw_Window, and bw_BrowserWindow when cross-compiling to x86_64-pc-windows-msvc, breaking Rust accesses like (*window).user_data and (*bw).impl_.controller. Bumping to 0.72 fixes the opaque-struct regression. Removing -DBW_BINDGEN lets bindgen include the platform impl headers (application/win32.h, browser_window/edge2.h) so the Rust-side struct layouts match what cc::Build produces. Callers cross-compiling on a non -Linux host need to point bindgen at Windows headers via BINDGEN_EXTRA_CLANG_ARGS_x86_64_pc_windows_msvc (e.g. xwin's SDK cache). Updated ParseCallbacks::item_name to bindgen 0.70+'s ItemInfo signature. Co-Authored-By: Claude Opus 4.7 (1M context) --- c/Cargo.toml | 2 +- c/build.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/c/Cargo.toml b/c/Cargo.toml index e7a829c..14cd1ab 100644 --- a/c/Cargo.toml +++ b/c/Cargo.toml @@ -19,6 +19,6 @@ path = "src/lib.rs" crate-type = ["rlib"] [build-dependencies] -bindgen = "^0.69" +bindgen = "^0.72" cc = "^1.0" pkg-config = "^0.3" diff --git a/c/build.rs b/c/build.rs index c482521..be71470 100644 --- a/c/build.rs +++ b/c/build.rs @@ -149,7 +149,6 @@ fn main() { ************************ */ let mut bgbuilder = bindgen::Builder::default() .parse_callbacks(Box::new(BwBindgenCallbacks {})) - .clang_arg("-DBW_BINDGEN") .header("src/application.h") .header("src/browser_window.h") .header("src/cookie.h") @@ -405,5 +404,7 @@ fn main() { } impl bindgen::callbacks::ParseCallbacks for BwBindgenCallbacks { - fn item_name(&self, item_name: &str) -> Option { Some("c".to_owned() + item_name) } + fn item_name(&self, item_info: bindgen::callbacks::ItemInfo<'_>) -> Option { + Some("c".to_owned() + item_info.name) + } }