| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent aa87074 commit d877fa4
7 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -178,6 +178,13 @@ | |||
| 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" /> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,7 @@ | |||
| 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 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,7 @@ | |||
| 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 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,7 @@ | |||
| 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 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,7 @@ | |||
| 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 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,7 @@ | |||
| 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 | ||
| 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 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments