Skip to content

Commit 6eb59ec

Browse files
committed
Fix Py_Main for python 3
1 parent ce0545f commit 6eb59ec

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/runtime/runtime.cs

+7
Original file line numberDiff line numberDiff line change
@@ -546,10 +546,17 @@ internal unsafe static extern void
546546
internal unsafe static extern IntPtr
547547
PyGILState_GetThisThreadState();
548548

549+
#if (PYTHON32 || PYTHON33 || PYTHON34)
550+
[DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl,
551+
ExactSpelling=true, CharSet=CharSet.Ansi)]
552+
public unsafe static extern int
553+
Py_Main(int argc, [MarshalAsAttribute(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr)] string[] argv);
554+
#else
549555
[DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl,
550556
ExactSpelling=true, CharSet=CharSet.Ansi)]
551557
public unsafe static extern int
552558
Py_Main(int argc, string[] argv);
559+
#endif
553560

554561
[DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl,
555562
ExactSpelling=true, CharSet=CharSet.Ansi)]

0 commit comments

Comments
 (0)