From 7041ca7f4872b32cb69e69edc46d7c3451d687f7 Mon Sep 17 00:00:00 2001 From: neuecc Date: Mon, 4 Sep 2023 20:57:50 +0900 Subject: [PATCH] working for nonnull(not yet) --- csbindgen-tests/src/lib.rs | 16 ++++++++++------ dotnet-sandbox/NativeMethods.cs | 3 +++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/csbindgen-tests/src/lib.rs b/csbindgen-tests/src/lib.rs index 1ac903a..fc23f84 100644 --- a/csbindgen-tests/src/lib.rs +++ b/csbindgen-tests/src/lib.rs @@ -178,13 +178,17 @@ pub extern "C" fn test_func_issue_39(_f: extern "C" fn(i32)){ pub extern "C" fn test_func_issue_39_variation1(_f: extern "C" fn(i32, i32, i32)){ } -#[no_mangle] -pub extern "C" fn nonnull_parameter(_output_word_uuid: NonNull<[u8; 16]>){ -} +// #[no_mangle] +// pub extern "C" fn nonnull_parameter(_output_word_uuid: NonNull<[u8; 16]>){ +// } -#[no_mangle] -pub extern "C" fn non_nonnull_parameter(_output_word_uuid: [u8; 16]){ -} +// #[no_mangle] +// pub extern "C" fn non_nonnull_parameter(_output_word_uuid: [u8; 16]){ +// } + +// #[no_mangle] +// pub extern "C" fn non_nonnull_parameter2(_output_word_uuid: NonNull){ +// } #[no_mangle] pub extern "C" fn ge(_f: extern "C" fn(i32, i32, i32)){ diff --git a/dotnet-sandbox/NativeMethods.cs b/dotnet-sandbox/NativeMethods.cs index b64dd39..6b00708 100644 --- a/dotnet-sandbox/NativeMethods.cs +++ b/dotnet-sandbox/NativeMethods.cs @@ -58,6 +58,9 @@ namespace CsBindgen [DllImport(__DllName, EntryPoint = "non_nonnull_parameter", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void non_nonnull_parameter(void/* byte[] */ _output_word_uuid); + [DllImport(__DllName, EntryPoint = "non_nonnull_parameter2", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void non_nonnull_parameter2(byte _output_word_uuid); + [DllImport(__DllName, EntryPoint = "ge", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void ge(delegate* unmanaged[Cdecl] _f);