Include all interop files in solution. · pythonnet/pythonnet@d877fa4 · GitHub
Skip to content

Commit d877fa4

Browse files
committed
Include all interop files in solution.
Use defines to ensure only the relevant code is included, but add all files to the project when PythonInteropFile isn't defined. When building from setup.py explicitly use the interop file that matches the python.exe in use.
1 parent aa87074 commit d877fa4

7 files changed

Lines changed: 32 additions & 7 deletions

File tree

src/runtime/Python.Runtime.csproj

Lines changed: 7 additions & 0 deletions

src/runtime/interop26.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
1010
// FOR A PARTICULAR PURPOSE.
1111
// ==========================================================================
12-
12+
#if (PYTHON26)
1313
using System;
1414
using System.Collections;
1515
using System.Collections.Specialized;
@@ -150,3 +150,4 @@ public static int magic() {
150150
public static int members = 0;
151151
}
152152
}
153+
#endif

src/runtime/interop27.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
1010
// FOR A PARTICULAR PURPOSE.
1111
// ==========================================================================
12-
12+
#if (PYTHON27)
1313
using System;
1414
using System.Collections;
1515
using System.Collections.Specialized;
@@ -150,3 +150,4 @@ public static int magic() {
150150
public static int members = 0;
151151
}
152152
}
153+
#endif

src/runtime/interop32.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
1010
// FOR A PARTICULAR PURPOSE.
1111
// ==========================================================================
12-
12+
#if (PYTHON32)
1313
using System;
1414
using System.Collections;
1515
using System.Collections.Specialized;
@@ -141,3 +141,4 @@ public static int magic() {
141141
public static int members = 0;
142142
}
143143
}
144+
#endif

src/runtime/interop34.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
1010
// FOR A PARTICULAR PURPOSE.
1111
// ==========================================================================
12-
12+
#if (PYTHON34)
1313
using System;
1414
using System.Collections;
1515
using System.Collections.Specialized;
@@ -144,3 +144,4 @@ public static int magic() {
144144
public static int members = 0;
145145
}
146146
}
147+
#endif

src/runtime/interop35.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
1010
// FOR A PARTICULAR PURPOSE.
1111
// ==========================================================================
12-
12+
#if (PYTHON35)
1313
using System;
1414
using System.Collections;
1515
using System.Collections.Specialized;
@@ -149,3 +149,4 @@ public static int magic() {
149149
public static int members = 0;
150150
}
151151
}
152+
#endif

tools/geninterop/geninterop.py

Lines changed: 15 additions & 2 deletions

0 commit comments

Comments
 (0)