GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Include all interop files in solution. · pythonnet/pythonnet@d877fa4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src/runtime
    • Python.Runtime.csproj
    • interop26.cs
    • interop27.cs
    • interop32.cs
    • interop34.cs
    • interop35.cs
  • tools/geninterop
    • geninterop.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/runtime/Python.Runtime.csproj‎

Copy file name to clipboardExpand all lines: src/runtime/Python.Runtime.csproj
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,13 @@
178178
<ItemGroup Condition=" '$(PythonInteropFile)' != '' ">
179179
<Compile Include="$(PythonInteropFile)" />
180180
</ItemGroup>
181+
<ItemGroup Condition=" '$(PythonInteropFile)' == '' ">
182+
<Compile Include="interop26.cs" />
183+
<Compile Include="interop27.cs" />
184+
<Compile Include="interop32.cs" />
185+
<Compile Include="interop34.cs" />
186+
<Compile Include="interop35.cs" />
187+
</ItemGroup>
181188
<ItemGroup>
182189
<None Include="buildclrmodule.bat" />
183190
<None Include="clrmodule.il" />
Collapse file

‎src/runtime/interop26.cs‎

Copy file name to clipboardExpand all lines: src/runtime/interop26.cs
+2-1Lines 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
Collapse file

‎src/runtime/interop27.cs‎

Copy file name to clipboardExpand all lines: src/runtime/interop27.cs
+2-1Lines 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
Collapse file

‎src/runtime/interop32.cs‎

Copy file name to clipboardExpand all lines: src/runtime/interop32.cs
+2-1Lines 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
Collapse file

‎src/runtime/interop34.cs‎

Copy file name to clipboardExpand all lines: src/runtime/interop34.cs
+2-1Lines 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
Collapse file

‎src/runtime/interop35.cs‎

Copy file name to clipboardExpand all lines: src/runtime/interop35.cs
+2-1Lines 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
Collapse file

‎tools/geninterop/geninterop.py‎

Copy file name to clipboardExpand all lines: tools/geninterop/geninterop.py
+15-2Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,18 @@ def preprocess_python_headers():
198198
def gen_interop_code(members):
199199
"""Generate the TypeOffset C# class"""
200200

201+
defines = [
202+
"PYTHON%d%s" % (sys.version_info[:2])
203+
]
204+
205+
if hasattr(sys, "abiflags"):
206+
if "d" in sys.abiflags:
207+
defines.append("PYTHON_WITH_PYDEBUG")
208+
if "m" in sys.abiflags:
209+
defines.append("PYTHON_WITH_PYMALLOC")
210+
if "u" in sys.abiflags:
211+
defines.append("PYTHON_WITH_WIDE_UNICODE")
212+
201213
class_definition = """
202214
// Auto-generated by %s.
203215
// DOT NOT MODIFIY BY HAND.
@@ -209,7 +221,7 @@ def gen_interop_code(members):
209221
// WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
210222
// FOR A PARTICULAR PURPOSE.
211223
// ==========================================================================
212-
224+
#if (%s)
213225
using System;
214226
using System.Collections;
215227
using System.Collections.Specialized;
@@ -236,7 +248,7 @@ def gen_interop_code(members):
236248
}
237249
238250
// Auto-generated from PyHeapTypeObject in Python.h
239-
""" % os.path.basename(__file__)
251+
""" % (os.path.basename(__file__), " && ".join(defines))
240252

241253
# All the members are sizeof(void*) so we don't need to do any
242254
# extra work to determine the size based on the type.
@@ -249,6 +261,7 @@ def gen_interop_code(members):
249261
public static int members = 0;
250262
}
251263
}
264+
#endif
252265
"""
253266
return class_definition
254267

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.