From 8a047b31c559e7002f8d2f26b615c2dc15b5275a Mon Sep 17 00:00:00 2001 From: yamachu Date: Wed, 6 Sep 2023 22:27:51 +0900 Subject: [PATCH] Add reference type sample case --- csbindgen-tests/src/lib.rs | 2 ++ dotnet-sandbox/NativeMethods.cs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/csbindgen-tests/src/lib.rs b/csbindgen-tests/src/lib.rs index 4983013..7bd3bc0 100644 --- a/csbindgen-tests/src/lib.rs +++ b/csbindgen-tests/src/lib.rs @@ -606,6 +606,8 @@ pub struct CallbackTable { pub foobar: extern "C" fn(i: i32) -> i32, } +pub extern "C" fn reference_type(_a: &i32, _b: &*mut i32, _c: &[u8; 16], _d: &Context) {} + // fn run_physix(){ // unsafe { // let foundation = physx_create_foundation(); diff --git a/dotnet-sandbox/NativeMethods.cs b/dotnet-sandbox/NativeMethods.cs index 01e7a4b..ef6c335 100644 --- a/dotnet-sandbox/NativeMethods.cs +++ b/dotnet-sandbox/NativeMethods.cs @@ -176,6 +176,9 @@ namespace CsBindgen [DllImport(__DllName, EntryPoint = "call_bindgen_lz4", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void call_bindgen_lz4(); + [DllImport(__DllName, EntryPoint = "reference_type", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void reference_type(int* _a, int** _b, void/* byte[] */* _c, Context* _d); + }