From 0674da55d09f2f801912bbd1a2f19f0ba0c0ce2b Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 15 Nov 2017 16:21:06 +0100 Subject: [PATCH 1/2] [src] Fix UInt64 != long typo in method signature. --- src/ObjCRuntime/Dlfcn.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ObjCRuntime/Dlfcn.cs b/src/ObjCRuntime/Dlfcn.cs index 764c2e832770..69824e1ca756 100644 --- a/src/ObjCRuntime/Dlfcn.cs +++ b/src/ObjCRuntime/Dlfcn.cs @@ -211,6 +211,7 @@ public static ulong GetUInt64 (IntPtr handle, string symbol) return (ulong) Marshal.ReadInt64 (indirect); } +#if !XAMCORE_4_0 public static void SetUInt64 (IntPtr handle, string symbol, long value) { var indirect = dlsym (handle, symbol); @@ -219,6 +220,16 @@ public static void SetUInt64 (IntPtr handle, string symbol, long value) Marshal.WriteInt64 (indirect, (long) value); } +#endif + + public static void SetUInt64 (IntPtr handle, string symbol, ulong value) + { + var indirect = dlsym (handle, symbol); + if (indirect == IntPtr.Zero) + return; + + Marshal.WriteInt64 (indirect, (long) value); + } public static void SetString (IntPtr handle, string symbol, string value) { From 95f2e5971e88bf0d18667d654899bf4963affd7a Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 15 Nov 2017 20:17:40 +0100 Subject: [PATCH 2/2] [src] Add Obsolete to incorrect API. --- src/ObjCRuntime/Dlfcn.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ObjCRuntime/Dlfcn.cs b/src/ObjCRuntime/Dlfcn.cs index 69824e1ca756..578cd2ef03c1 100644 --- a/src/ObjCRuntime/Dlfcn.cs +++ b/src/ObjCRuntime/Dlfcn.cs @@ -212,6 +212,7 @@ public static ulong GetUInt64 (IntPtr handle, string symbol) } #if !XAMCORE_4_0 + [Obsolete ("Use 'SetInt64' for long values instead.")] public static void SetUInt64 (IntPtr handle, string symbol, long value) { var indirect = dlsym (handle, symbol);