Skip to content

Added side-by-side VS 2017 build with NetStandard 1.5 support. #444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 19 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions src/runtime/runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,10 @@ internal static void Initialize()

#if PYTHON3
IntPtr dllLocal = IntPtr.Zero;
if (PythonDll != "__Internal")
if (_PythonDll != "__Internal")
{
#if !NETSTANDARD1_5
NativeMethods.LoadLibrary(PythonDll);
NativeMethods.LoadLibrary(_PythonDll);
#endif
}
#if !NETSTANDARD1_5
Expand Down Expand Up @@ -682,7 +682,7 @@ string[] argv
return result;
}
#else
[DllImport(PythonDll)]
[DllImport(_PythonDll)]
public static extern int Py_Main(
int argc,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(StrArrayMarshaler))] string[] argv
Expand Down Expand Up @@ -872,7 +872,7 @@ internal static string PyObject_GetTypeName(IntPtr op)
internal static extern IntPtr PyObject_CallObject(IntPtr pointer, IntPtr args);

#if PYTHON3
[DllImport(PythonDll, CallingConvention = CallingConvention.Cdecl)]
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
internal static extern int PyObject_RichCompareBool(IntPtr value1, IntPtr value2, int opid);

internal static int PyObject_Compare(IntPtr value1, IntPtr value2)
Expand Down Expand Up @@ -932,7 +932,7 @@ internal static int PyObject_Compare(IntPtr value1, IntPtr value2)
internal static extern IntPtr PyObject_Str(IntPtr pointer);

#if PYTHON3
[DllImport(PythonDll, CallingConvention = CallingConvention.Cdecl,
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "PyObject_Str")]
internal static extern IntPtr PyObject_Unicode(IntPtr pointer);
#elif PYTHON2
Expand All @@ -949,7 +949,7 @@ internal static int PyObject_Compare(IntPtr value1, IntPtr value2)
//====================================================================

#if PYTHON3
[DllImport(PythonDll, CallingConvention = CallingConvention.Cdecl,
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "PyNumber_Long")]
internal static extern IntPtr PyNumber_Int(IntPtr ob);
#elif PYTHON2
Expand Down Expand Up @@ -989,19 +989,19 @@ internal static IntPtr PyInt_FromInt64(long value)
}

#if PYTHON3
[DllImport(PythonDll, CallingConvention = CallingConvention.Cdecl,
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "PyLong_FromLong")]
private static extern IntPtr PyInt_FromLong(IntPtr value);

[DllImport(PythonDll, CallingConvention = CallingConvention.Cdecl,
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "PyLong_AsLong")]
internal static extern int PyInt_AsLong(IntPtr value);

[DllImport(PythonDll, CallingConvention = CallingConvention.Cdecl,
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "PyLong_FromString")]
internal static extern IntPtr PyInt_FromString(string value, IntPtr end, int radix);

[DllImport(PythonDll, CallingConvention = CallingConvention.Cdecl,
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "PyLong_GetMax")]
internal static extern int PyInt_GetMax();
#elif PYTHON2
Expand Down Expand Up @@ -1214,10 +1214,10 @@ internal static IntPtr PyString_FromString(string value)
}

#if PYTHON3
[DllImport(PythonDll, CallingConvention = CallingConvention.Cdecl)]
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr PyBytes_FromString(string op);

[DllImport(PythonDll, CallingConvention = CallingConvention.Cdecl)]
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
internal static extern int PyBytes_Size(IntPtr op);

internal static IntPtr PyBytes_AS_STRING(IntPtr ob)
Expand Down Expand Up @@ -1249,14 +1249,14 @@ int size
return result;
}
#else
[DllImport(PythonDll, EntryPoint = "PyUnicode_FromStringAndSize")]
[DllImport(_PythonDll, EntryPoint = "PyUnicode_FromStringAndSize")]
internal static extern IntPtr PyString_FromStringAndSize(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))] string value,
int size
);
#endif

[DllImport(PythonDll, CallingConvention = CallingConvention.Cdecl)]
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr PyUnicode_FromStringAndSize(IntPtr value, int size);
#elif PYTHON2
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
Expand All @@ -1275,10 +1275,10 @@ internal static bool PyUnicode_Check(IntPtr ob)
}

#if PYTHON3
[DllImport(PythonDll, CallingConvention = CallingConvention.Cdecl)]
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr PyUnicode_FromObject(IntPtr ob);

[DllImport(PythonDll, CallingConvention = CallingConvention.Cdecl)]
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr PyUnicode_FromEncodedObject(IntPtr ob, IntPtr enc, IntPtr err);

#if NETSTANDARD1_5
Expand Down Expand Up @@ -1308,7 +1308,7 @@ int size
return result;
}
#else
[DllImport(PythonDll)]
[DllImport(_PythonDll)]
internal static extern IntPtr PyUnicode_FromKindAndData(
int kind,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UcsMarshaler))] string s,
Expand All @@ -1321,13 +1321,13 @@ internal static IntPtr PyUnicode_FromUnicode(string s, int size)
return PyUnicode_FromKindAndData(UCS, s, size);
}

[DllImport(PythonDll, CallingConvention = CallingConvention.Cdecl)]
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
internal static extern int PyUnicode_GetSize(IntPtr ob);

[DllImport(PythonDll, CallingConvention = CallingConvention.Cdecl)]
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr PyUnicode_AsUnicode(IntPtr ob);

[DllImport(PythonDll, CallingConvention = CallingConvention.Cdecl)]
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr PyUnicode_FromOrdinal(int c);
#elif PYTHON2
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl,
Expand Down Expand Up @@ -1588,7 +1588,7 @@ internal static bool PyIter_Check(IntPtr pointer)
internal static extern string PyModule_GetFilename(IntPtr module);

#if PYTHON3
[DllImport(PythonDll, CallingConvention = CallingConvention.Cdecl)]
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr PyModule_Create2(IntPtr module, int apiver);
#endif

Expand Down Expand Up @@ -1632,7 +1632,7 @@ int updatepath
}
}
#else
[DllImport(PythonDll)]
[DllImport(_PythonDll)]
internal static extern void PySys_SetArgvEx(
int argc,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(StrArrayMarshaler))] string[] argv,
Expand Down