Skip to content

Commit

Permalink
Fix Py_Main for python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyroberts committed Nov 7, 2014
1 parent ce0545f commit 6eb59ec
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/runtime/runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -546,10 +546,17 @@ internal unsafe static extern void
internal unsafe static extern IntPtr
PyGILState_GetThisThreadState();

#if (PYTHON32 || PYTHON33 || PYTHON34)
[DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl,
ExactSpelling=true, CharSet=CharSet.Ansi)]
public unsafe static extern int
Py_Main(int argc, [MarshalAsAttribute(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr)] string[] argv);
#else
[DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl,
ExactSpelling=true, CharSet=CharSet.Ansi)]
public unsafe static extern int
Py_Main(int argc, string[] argv);
#endif

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

0 comments on commit 6eb59ec

Please sign in to comment.