From 7cb00ee34c72d0c835c365ae56cb3502ec5521ba Mon Sep 17 00:00:00 2001 From: amos402 Date: Thu, 20 Aug 2020 02:15:19 +0800 Subject: [PATCH 1/2] Remove non-existent PInvoke functions --- src/runtime/runtime.cs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/runtime/runtime.cs b/src/runtime/runtime.cs index 55c827b67..91229a0f4 100644 --- a/src/runtime/runtime.cs +++ b/src/runtime/runtime.cs @@ -846,12 +846,6 @@ internal static IntPtr Py_CompileStringFlags(string str, string file, int start, [DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr PyCFunction_Call(IntPtr func, IntPtr args, IntPtr kw); - [DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)] - internal static extern IntPtr PyInstance_New(IntPtr cls, IntPtr args, IntPtr kw); - - [DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)] - internal static extern IntPtr PyInstance_NewRaw(IntPtr cls, IntPtr dict); - [DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr PyMethod_New(IntPtr func, IntPtr self, IntPtr cls); @@ -1018,9 +1012,6 @@ internal static long PyObject_Size(IntPtr pointer) // Python buffer API //==================================================================== - [DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)] - internal static extern int PyObject_CheckBuffer(IntPtr obj); - [DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)] internal static extern int PyObject_GetBuffer(IntPtr exporter, ref Py_buffer view, int flags); @@ -1793,7 +1784,7 @@ internal static IntPtr PyType_GenericAlloc(IntPtr type, long n) [DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr _PyObject_GetDictPtr(IntPtr obj); - [DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)] + [DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl, EntryPoint = "_PyObject_GC_New")] internal static extern IntPtr PyObject_GC_New(IntPtr tp); [DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)] From b07d1cae506dbf4be332140b939f21a2d4eb90b7 Mon Sep 17 00:00:00 2001 From: amos402 Date: Tue, 25 Aug 2020 19:06:21 +0800 Subject: [PATCH 2/2] Remove PyObject_GC_New --- src/runtime/runtime.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/runtime/runtime.cs b/src/runtime/runtime.cs index 91229a0f4..7acdc0f7e 100644 --- a/src/runtime/runtime.cs +++ b/src/runtime/runtime.cs @@ -1784,9 +1784,6 @@ internal static IntPtr PyType_GenericAlloc(IntPtr type, long n) [DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr _PyObject_GetDictPtr(IntPtr obj); - [DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl, EntryPoint = "_PyObject_GC_New")] - internal static extern IntPtr PyObject_GC_New(IntPtr tp); - [DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)] internal static extern void PyObject_GC_Del(IntPtr tp);