From 75a3c2b6529f2c94318df74a6d38a3843def8b62 Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Fri, 22 Apr 2022 15:41:14 -0400 Subject: [PATCH] [glib] Fix `g_filename_from_utf8` signature for 64 bits platforms Fixes https://github.com/GtkSharp/GtkSharp/issues/345 --- Source/Libs/GLibSharp/Marshaller.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/Libs/GLibSharp/Marshaller.cs b/Source/Libs/GLibSharp/Marshaller.cs index 449e5b7f3..3603a50d9 100644 --- a/Source/Libs/GLibSharp/Marshaller.cs +++ b/Source/Libs/GLibSharp/Marshaller.cs @@ -117,7 +117,7 @@ namespace GLib { return ret; } [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - delegate IntPtr d_g_filename_from_utf8(IntPtr mem, int len, IntPtr read, out IntPtr written, out IntPtr error); + delegate IntPtr d_g_filename_from_utf8(IntPtr mem, IntPtr len, IntPtr read, out IntPtr written, out IntPtr error); static d_g_filename_from_utf8 g_filename_from_utf8 = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.GLib), "g_filename_from_utf8")); public static IntPtr StringToFilenamePtr (string str) @@ -125,9 +125,8 @@ namespace GLib { if (str == null) return IntPtr.Zero; - IntPtr dummy, error; IntPtr utf8 = StringToPtrGStrdup (str); - IntPtr result = g_filename_from_utf8 (utf8, -1, IntPtr.Zero, out dummy, out error); + IntPtr result = g_filename_from_utf8 (utf8, (IntPtr)(-1), IntPtr.Zero, out _, out var error); g_free (utf8); if (error != IntPtr.Zero)