Add sample case

This commit is contained in:
yamachu 2023-09-06 19:35:34 +09:00
parent dd6330a573
commit c27e01bd90
2 changed files with 25 additions and 0 deletions

View File

@ -606,6 +606,20 @@ pub struct CallbackTable {
pub foobar: extern "C" fn(i: i32) -> i32, pub foobar: extern "C" fn(i: i32) -> i32,
} }
pub struct InternalHiddenContext {
pub a: i32
}
pub struct TreatAsEmptyStruct {
internal: std::sync::Arc<InternalHiddenContext>
}
#[no_mangle]
pub unsafe extern "C" fn init_treat_as_empty_struct_context(_out: NonNull<Box<TreatAsEmptyStruct>>) {}
#[no_mangle]
pub unsafe extern "C" fn free_treat_as_empty_struct_context(_src: *mut TreatAsEmptyStruct) {}
// fn run_physix(){ // fn run_physix(){
// unsafe { // unsafe {
// let foundation = physx_create_foundation(); // let foundation = physx_create_foundation();

View File

@ -176,6 +176,12 @@ namespace CsBindgen
[DllImport(__DllName, EntryPoint = "call_bindgen_lz4", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [DllImport(__DllName, EntryPoint = "call_bindgen_lz4", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void call_bindgen_lz4(); public static extern void call_bindgen_lz4();
[DllImport(__DllName, EntryPoint = "init_treat_as_empty_struct_context", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void init_treat_as_empty_struct_context(TreatAsEmptyStruct** _out);
[DllImport(__DllName, EntryPoint = "free_treat_as_empty_struct_context", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void free_treat_as_empty_struct_context(TreatAsEmptyStruct* _src);
} }
@ -260,6 +266,11 @@ namespace CsBindgen
public delegate* unmanaged[Cdecl]<int, int> foobar; public delegate* unmanaged[Cdecl]<int, int> foobar;
} }
[StructLayout(LayoutKind.Sequential)]
internal unsafe partial struct TreatAsEmptyStruct
{
}
[Flags] [Flags]
internal enum EnumFlags : uint internal enum EnumFlags : uint