| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 51a1868 commit f1da55e
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,11 +17,13 @@ This document follows the conventions laid out in [Keep a CHANGELOG][]. | |||
| 17 | 17 | - Moved wheel import in setup.py inside of a try/except to prevent pip collection failures | |
| 18 | 18 | - Removes PyLong_GetMax and PyClass_New when targetting Python3 | |
| 19 | 19 | - Added support for converting python iterators to C# arrays | |
| 20 | + - Changed usage of obselete function GetDelegateForFunctionPointer(IntPtr, Type) to GetDelegateForFunctionPointer<TDelegate>(IntPtr) | ||
| 20 | 21 | ||
| 21 | 22 | ### Fixed | |
| 22 | 23 | ||
| 23 | 24 | - Fixed runtime that fails loading when using pythonnet in an environment | |
| 24 | 25 | together with Nuitka | |
| 26 | + - Fixes bug where delegates get casts (dotnetcore) | ||
| 25 | 27 | ||
| 26 | 28 | ## [2.4.0][] | |
| 27 | 29 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,19 +32,21 @@ internal class NativeCall | |||
| 32 | 32 | ||
| 33 | 33 | public static void Void_Call_1(IntPtr fp, IntPtr a1) | |
| 34 | 34 | { | |
| 35 | - ((Void_1_Delegate)Marshal.GetDelegateForFunctionPointer(fp, typeof(Void_1_Delegate)))(a1); | ||
| 35 | + var d = Marshal.GetDelegateForFunctionPointer<Interop.DestructorFunc>(fp); | ||
| 36 | + d(a1); | ||
| 36 | 37 | } | |
| 37 | 38 | ||
| 38 | 39 | public static IntPtr Call_3(IntPtr fp, IntPtr a1, IntPtr a2, IntPtr a3) | |
| 39 | 40 | { | |
| 40 | - var d = (Interop.TernaryFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(Interop.TernaryFunc)); | ||
| 41 | + var d = Marshal.GetDelegateForFunctionPointer<Interop.TernaryFunc>(fp); | ||
| 41 | 42 | return d(a1, a2, a3); | |
| 42 | 43 | } | |
| 43 | 44 | ||
| 44 | 45 | ||
| 45 | 46 | public static int Int_Call_3(IntPtr fp, IntPtr a1, IntPtr a2, IntPtr a3) | |
| 46 | 47 | { | |
| 47 | - return ((Int_3_Delegate)Marshal.GetDelegateForFunctionPointer(fp, typeof(Int_3_Delegate)))(a1, a2, a3); | ||
| 48 | + var d = Marshal.GetDelegateForFunctionPointer<Interop.ObjObjArgFunc>(fp); | ||
| 49 | + return d(a1, a2, a3); | ||
| 48 | 50 | } | |
| 49 | 51 | #else | |
| 50 | 52 | private static AssemblyBuilder aBuilder; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments