Skip to content

Commit fef7067

Browse files
committed
Polyfill for 4.0: types referenced by function pointer tables
1 parent 512ccba commit fef7067

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

godot-codegen/src/interface_generator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub(crate) fn generate_sys_interface_file(
3131
#[path = "../compat/compat_4_0.rs"]
3232
mod compat_4_0;
3333

34-
pub use compat_4_0::InitCompat;
34+
pub use compat_4_0::*;
3535
}
3636
} else {
3737
generate_proc_address_funcs(h_path)

godot-ffi/src/compat/compat_4_0.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,22 @@ impl BindingCompat for *const sys::GDExtensionInterface {
5555
unsafe { **self }
5656
}
5757
}
58+
59+
// ----------------------------------------------------------------------------------------------------------------------------------------------
60+
// Polyfill for types referenced in function pointer tables
61+
62+
pub(crate) type GDExtensionInterfaceVariantGetPtrBuiltinMethod = Option<
63+
unsafe extern "C" fn(
64+
p_type: crate::GDExtensionVariantType,
65+
p_method: crate::GDExtensionConstStringNamePtr,
66+
p_hash: crate::GDExtensionInt,
67+
) -> crate::GDExtensionPtrBuiltInMethod,
68+
>;
69+
70+
pub(crate) type GDExtensionInterfaceClassdbGetMethodBind = Option<
71+
unsafe extern "C" fn(
72+
p_classname: crate::GDExtensionConstStringNamePtr,
73+
p_methodname: crate::GDExtensionConstStringNamePtr,
74+
p_hash: crate::GDExtensionInt,
75+
) -> crate::GDExtensionMethodBindPtr,
76+
>;

0 commit comments

Comments
 (0)