Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Jan 30, 2023
1 parent 69acf87 commit 2f0e9e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/FetchBannerlordVersion.Native/Bindings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace FetchBannerlordVersion.Native
{
public static unsafe partial class Bindings
{
[UnmanagedCallersOnly(EntryPoint = "bfv_get_change_set", CallConvs = new [] { typeof(CallConvCdecl) })]
[UnmanagedCallersOnly(EntryPoint = "bfv_get_change_set", CallConvs = new[] { typeof(CallConvCdecl) })]
public static return_value_uint32* GetChangeSet(param_string* p_game_folder_path, param_string* p_lib_assembly)
{
Logger.LogInput(p_game_folder_path, p_lib_assembly);
Expand All @@ -30,7 +30,7 @@ public static unsafe partial class Bindings
}
}

[UnmanagedCallersOnly(EntryPoint = "bfv_get_version", CallConvs = new [] { typeof(CallConvCdecl) })]
[UnmanagedCallersOnly(EntryPoint = "bfv_get_version", CallConvs = new[] { typeof(CallConvCdecl) })]
public static return_value_string* GetVersion(param_string* p_game_folder_path, param_string* p_lib_assembly)
{
Logger.LogInput(p_game_folder_path, p_lib_assembly);
Expand All @@ -51,7 +51,7 @@ public static unsafe partial class Bindings
}
}

[UnmanagedCallersOnly(EntryPoint = "bfv_get_version_type", CallConvs = new [] { typeof(CallConvCdecl) })]
[UnmanagedCallersOnly(EntryPoint = "bfv_get_version_type", CallConvs = new[] { typeof(CallConvCdecl) })]
public static return_value_uint32* GetVersionType(param_string* p_game_folder_path, param_string* p_lib_assembly)
{
Logger.LogInput(p_game_folder_path, p_lib_assembly);
Expand Down
8 changes: 4 additions & 4 deletions test/FetchBannerlordVersion.Native.Tests/Utils2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ public static partial class Utils2
{
private const string DllPath = "../../../../../src/FetchBannerlordVersion.Native/bin/Release/net7.0/win-x64/native/FetchBannerlordVersion.Native.dll";


static unsafe Utils2()
{
Allocator.SetCustom(&alloc, &dealloc);
}

[LibraryImport(DllPath), UnmanagedCallConv(CallConvs = new[] { typeof(CallConvStdcall) })]
private static unsafe partial void* alloc(nuint size);
[LibraryImport(DllPath), UnmanagedCallConv(CallConvs = new[] { typeof(CallConvStdcall) })]
private static unsafe partial void dealloc(void* ptr);
[LibraryImport(DllPath), UnmanagedCallConv(CallConvs = new[] { typeof(CallConvStdcall) })]
private static unsafe partial int alloc_alive_count();

public static int LibraryAliveCount() => alloc_alive_count();

public static unsafe ReadOnlySpan<char> ToSpan(param_string* value) => new SafeStringMallocHandle((char*) value, false).ToSpan();

public static unsafe string GetResult(return_value_string* ret)
Expand Down

0 comments on commit 2f0e9e2

Please sign in to comment.