GeezerVison is showing github.com — Include all interop files in solution. · pythonnet/pythonnet@d877fa4
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: src/runtime/Python.Runtime.csproj +7Lines changed: 7 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 178 | 178 | <ItemGroup Condition=" '$(PythonInteropFile)' != '' "> | 179 | 179 | <Compile Include="$(PythonInteropFile)" /> | 180 | 180 | </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> | 181 | 188 | <ItemGroup> | 182 | 189 | <None Include="buildclrmodule.bat" /> | 183 | 190 | <None Include="clrmodule.il" /> | |
Collapse file Copy file name to clipboardExpand all lines: src/runtime/interop26.cs +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 9 | 9 | // WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS | 10 | 10 | // FOR A PARTICULAR PURPOSE. | 11 | 11 | // ========================================================================== | 12 | | - | | 12 | +#if (PYTHON26) | 13 | 13 | using System; | 14 | 14 | using System.Collections; | 15 | 15 | using System.Collections.Specialized; | @@ -150,3 +150,4 @@ public static int magic() { | 150 | 150 | public static int members = 0; | 151 | 151 | } | 152 | 152 | } | | 153 | +#endif |
Collapse file Copy file name to clipboardExpand all lines: src/runtime/interop27.cs +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 9 | 9 | // WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS | 10 | 10 | // FOR A PARTICULAR PURPOSE. | 11 | 11 | // ========================================================================== | 12 | | - | | 12 | +#if (PYTHON27) | 13 | 13 | using System; | 14 | 14 | using System.Collections; | 15 | 15 | using System.Collections.Specialized; | @@ -150,3 +150,4 @@ public static int magic() { | 150 | 150 | public static int members = 0; | 151 | 151 | } | 152 | 152 | } | | 153 | +#endif |
Collapse file Copy file name to clipboardExpand all lines: src/runtime/interop32.cs +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 9 | 9 | // WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS | 10 | 10 | // FOR A PARTICULAR PURPOSE. | 11 | 11 | // ========================================================================== | 12 | | - | | 12 | +#if (PYTHON32) | 13 | 13 | using System; | 14 | 14 | using System.Collections; | 15 | 15 | using System.Collections.Specialized; | @@ -141,3 +141,4 @@ public static int magic() { | 141 | 141 | public static int members = 0; | 142 | 142 | } | 143 | 143 | } | | 144 | +#endif |
Collapse file Copy file name to clipboardExpand all lines: src/runtime/interop34.cs +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 9 | 9 | // WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS | 10 | 10 | // FOR A PARTICULAR PURPOSE. | 11 | 11 | // ========================================================================== | 12 | | - | | 12 | +#if (PYTHON34) | 13 | 13 | using System; | 14 | 14 | using System.Collections; | 15 | 15 | using System.Collections.Specialized; | @@ -144,3 +144,4 @@ public static int magic() { | 144 | 144 | public static int members = 0; | 145 | 145 | } | 146 | 146 | } | | 147 | +#endif |
Collapse file Copy file name to clipboardExpand all lines: src/runtime/interop35.cs +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 9 | 9 | // WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS | 10 | 10 | // FOR A PARTICULAR PURPOSE. | 11 | 11 | // ========================================================================== | 12 | | - | | 12 | +#if (PYTHON35) | 13 | 13 | using System; | 14 | 14 | using System.Collections; | 15 | 15 | using System.Collections.Specialized; | @@ -149,3 +149,4 @@ public static int magic() { | 149 | 149 | public static int members = 0; | 150 | 150 | } | 151 | 151 | } | | 152 | +#endif |
Collapse file Copy file name to clipboardExpand all lines: tools/geninterop/geninterop.py +15-2Lines changed: 15 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -198,6 +198,18 @@ def preprocess_python_headers(): | 198 | 198 | def gen_interop_code(members): | 199 | 199 | """Generate the TypeOffset C# class""" | 200 | 200 |
| | 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 | + | 201 | 213 | class_definition = """ | 202 | 214 | // Auto-generated by %s. | 203 | 215 | // DOT NOT MODIFIY BY HAND. | @@ -209,7 +221,7 @@ def gen_interop_code(members): | 209 | 221 | // WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS | 210 | 222 | // FOR A PARTICULAR PURPOSE. | 211 | 223 | // ========================================================================== | 212 | | -
| | 224 | +#if (%s) | 213 | 225 | using System; | 214 | 226 | using System.Collections; | 215 | 227 | using System.Collections.Specialized; | @@ -236,7 +248,7 @@ def gen_interop_code(members): | 236 | 248 | } | 237 | 249 |
| 238 | 250 | // Auto-generated from PyHeapTypeObject in Python.h | 239 | | -""" % os.path.basename(__file__) | | 251 | +""" % (os.path.basename(__file__), " && ".join(defines)) | 240 | 252 |
| 241 | 253 | # All the members are sizeof(void*) so we don't need to do any | 242 | 254 | # extra work to determine the size based on the type. | @@ -249,6 +261,7 @@ def gen_interop_code(members): | 249 | 261 | public static int members = 0; | 250 | 262 | } | 251 | 263 | } | | 264 | +#endif | 252 | 265 | """ | 253 | 266 | return class_definition | 254 | 267 |
| |
|