Skip to content

Commit d451a7a

Browse files
committed
feat: fixed bindgen errors for virtual methods
1 parent fb9b048 commit d451a7a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

msfs/build.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,17 @@ fn main() {
3939
.blocklist_function("nvgStrokePaint")
4040
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
4141
.rustified_enum("SIMCONNECT_EXCEPTION")
42-
.impl_debug(false);
42+
.impl_debug(false)
43+
// `opaque_type` added to avoid alignmnet errors. Theese alignment errors are caused
44+
// because virutal methods are not well supported in rust-bindgen.
45+
.opaque_type("IGaugeCDrawableCreateParameters")
46+
.opaque_type("IGaugeCDrawableDrawParameters")
47+
.opaque_type("IGaugeCDrawable")
48+
.opaque_type("IGaugeCCallback")
49+
.opaque_type("ISerializableGaugeCCallback")
50+
.opaque_type("IAircraftCCallback")
51+
.opaque_type("IPanelCCallback")
52+
.opaque_type("IFSXPanelCCallback");
4353

4454
if wasm {
4555
bindings = bindings.clang_arg("-D_MSFS_WASM 1");

0 commit comments

Comments
 (0)