| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8fa699c commit 83ae857
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -138,7 +138,8 @@ def build_extension(self, ext): | |||
| 138 | 138 | unicode_width = ctypes.sizeof(ctypes.c_wchar) | |
| 139 | 139 | ||
| 140 | 140 | defines = [ | |
| 141 | - "PYTHON%d%s" % (sys.version_info[:2]), | ||
| 141 | + "PYTHON%d%d" % (sys.version_info[:2]), | ||
| 142 | + "PYTHON%d" % (sys.version_info[:1]), # Python Major Version | ||
| 142 | 143 | "UCS%d" % unicode_width, | |
| 143 | 144 | ] | |
| 144 | 145 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,10 +29,10 @@ | |||
| 29 | 29 | ||
| 30 | 30 | public class clrModule | |
| 31 | 31 | { | |
| 32 | - #if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35 || PYTHON36) | ||
| 32 | + #if PYTHON3 | ||
| 33 | 33 | [DllExport("PyInit_clr", CallingConvention.StdCall)] | |
| 34 | 34 | public static IntPtr PyInit_clr() | |
| 35 | - #else | ||
| 35 | + #elif PYTHON2 | ||
| 36 | 36 | [DllExport("initclr", CallingConvention.StdCall)] | |
| 37 | 37 | public static void initclr() | |
| 38 | 38 | #endif | |
@@ -99,9 +99,9 @@ public static void initclr() | |||
| 99 | 99 | #if DEBUG_PRINT | |
| 100 | 100 | Console.WriteLine("Could not load Python.Runtime"); | |
| 101 | 101 | #endif | |
| 102 | - #if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35 || PYTHON36) | ||
| 102 | + #if PYTHON3 | ||
| 103 | 103 | return IntPtr.Zero; | |
| 104 | - #else | ||
| 104 | + #elif PYTHON2 | ||
| 105 | 105 | return; | |
| 106 | 106 | #endif | |
| 107 | 107 | } | |
@@ -111,9 +111,9 @@ public static void initclr() | |||
| 111 | 111 | // So now we get the PythonEngine and execute the InitExt method on it. | |
| 112 | 112 | Type pythonEngineType = pythonRuntime.GetType("Python.Runtime.PythonEngine"); | |
| 113 | 113 | ||
| 114 | - #if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35 || PYTHON36) | ||
| 114 | + #if PYTHON3 | ||
| 115 | 115 | return (IntPtr)pythonEngineType.InvokeMember("InitExt", BindingFlags.InvokeMethod, null, null, null); | |
| 116 | - #else | ||
| 116 | + #elif PYTHON2 | ||
| 117 | 117 | pythonEngineType.InvokeMember("InitExt", BindingFlags.InvokeMethod, null, null, null); | |
| 118 | 118 | #endif | |
| 119 | 119 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,7 +18,7 @@ | |||
| 18 | 18 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'DebugMono|x86'"> | |
| 19 | 19 | <DebugSymbols>true</DebugSymbols> | |
| 20 | 20 | <OutputPath>bin\x86\DebugMono\</OutputPath> | |
| 21 | - <DefineConstants Condition="'$(DefineConstants)' == ''">DEBUG;TRACE</DefineConstants> | ||
| 21 | + <DefineConstants Condition="'$(DefineConstants)' == ''">TRACE;DEBUG;PYTHON2</DefineConstants> | ||
| 22 | 22 | <DebugType>full</DebugType> | |
| 23 | 23 | <PlatformTarget>x86</PlatformTarget> | |
| 24 | 24 | <ErrorReport>prompt</ErrorReport> | |
@@ -29,7 +29,7 @@ | |||
| 29 | 29 | <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugMono|x64'"> | |
| 30 | 30 | <DebugSymbols>true</DebugSymbols> | |
| 31 | 31 | <OutputPath>bin\x64\DebugMono\</OutputPath> | |
| 32 | - <DefineConstants Condition="'$(DefineConstants)' == ''">DEBUG;TRACE</DefineConstants> | ||
| 32 | + <DefineConstants Condition="'$(DefineConstants)' == ''">TRACE;DEBUG;PYTHON2</DefineConstants> | ||
| 33 | 33 | <DebugType>full</DebugType> | |
| 34 | 34 | <PlatformTarget>x64</PlatformTarget> | |
| 35 | 35 | <ErrorReport>prompt</ErrorReport> | |
@@ -39,8 +39,7 @@ | |||
| 39 | 39 | </PropertyGroup> | |
| 40 | 40 | <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseMono|x86'"> | |
| 41 | 41 | <OutputPath>bin\x86\ReleaseMono\</OutputPath> | |
| 42 | - <DefineConstants Condition="'$(DefineConstants)' == ''"> | ||
| 43 | - </DefineConstants> | ||
| 42 | + <DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON2</DefineConstants> | ||
| 44 | 43 | <Optimize>true</Optimize> | |
| 45 | 44 | <DebugType>pdbonly</DebugType> | |
| 46 | 45 | <PlatformTarget>x86</PlatformTarget> | |
@@ -51,8 +50,7 @@ | |||
| 51 | 50 | </PropertyGroup> | |
| 52 | 51 | <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseMono|x64'"> | |
| 53 | 52 | <OutputPath>bin\x64\ReleaseMono\</OutputPath> | |
| 54 | - <DefineConstants Condition="'$(DefineConstants)' == ''"> | ||
| 55 | - </DefineConstants> | ||
| 53 | + <DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON2</DefineConstants> | ||
| 56 | 54 | <Optimize>true</Optimize> | |
| 57 | 55 | <DebugType>pdbonly</DebugType> | |
| 58 | 56 | <PlatformTarget>x64</PlatformTarget> | |
@@ -64,7 +62,7 @@ | |||
| 64 | 62 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'DebugWin|x86'"> | |
| 65 | 63 | <DebugSymbols>true</DebugSymbols> | |
| 66 | 64 | <OutputPath>bin\x86\DebugWin\</OutputPath> | |
| 67 | - <DefineConstants Condition="'$(DefineConstants)' == ''">TRACE;DEBUG;DEBUG_PRINT</DefineConstants> | ||
| 65 | + <DefineConstants Condition="'$(DefineConstants)' == ''">TRACE;DEBUG;PYTHON2</DefineConstants> | ||
| 68 | 66 | <DebugType>full</DebugType> | |
| 69 | 67 | <PlatformTarget>x86</PlatformTarget> | |
| 70 | 68 | <ErrorReport>prompt</ErrorReport> | |
@@ -75,7 +73,7 @@ | |||
| 75 | 73 | <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugWin|x64'"> | |
| 76 | 74 | <DebugSymbols>true</DebugSymbols> | |
| 77 | 75 | <OutputPath>bin\x64\DebugWin\</OutputPath> | |
| 78 | - <DefineConstants Condition="'$(DefineConstants)' == ''">DEBUG;TRACE</DefineConstants> | ||
| 76 | + <DefineConstants Condition="'$(DefineConstants)' == ''">TRACE;DEBUG;PYTHON2</DefineConstants> | ||
| 79 | 77 | <DebugType>full</DebugType> | |
| 80 | 78 | <PlatformTarget>x64</PlatformTarget> | |
| 81 | 79 | <ErrorReport>prompt</ErrorReport> | |
@@ -85,8 +83,7 @@ | |||
| 85 | 83 | </PropertyGroup> | |
| 86 | 84 | <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseWin|x86'"> | |
| 87 | 85 | <OutputPath>bin\x86\ReleaseWin\</OutputPath> | |
| 88 | - <DefineConstants Condition="'$(DefineConstants)' == ''"> | ||
| 89 | - </DefineConstants> | ||
| 86 | + <DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON2</DefineConstants> | ||
| 90 | 87 | <Optimize>true</Optimize> | |
| 91 | 88 | <DebugType>pdbonly</DebugType> | |
| 92 | 89 | <PlatformTarget>x86</PlatformTarget> | |
@@ -97,8 +94,7 @@ | |||
| 97 | 94 | </PropertyGroup> | |
| 98 | 95 | <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseWin|x64'"> | |
| 99 | 96 | <OutputPath>bin\x64\ReleaseWin\</OutputPath> | |
| 100 | - <DefineConstants Condition="'$(DefineConstants)' == ''"> | ||
| 101 | - </DefineConstants> | ||
| 97 | + <DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON2</DefineConstants> | ||
| 102 | 98 | <Optimize>true</Optimize> | |
| 103 | 99 | <DebugType>pdbonly</DebugType> | |
| 104 | 100 | <PlatformTarget>x64</PlatformTarget> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,7 +13,7 @@ | |||
| 13 | 13 | </PropertyGroup> | |
| 14 | 14 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'ReleaseMono|x86'"> | |
| 15 | 15 | <OutputPath>bin\x86\ReleaseMono\</OutputPath> | |
| 16 | - <DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON27, UCS4</DefineConstants> | ||
| 16 | + <DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON2;PYTHON27;UCS4</DefineConstants> | ||
| 17 | 17 | <AllowUnsafeBlocks>true</AllowUnsafeBlocks> | |
| 18 | 18 | <Optimize>true</Optimize> | |
| 19 | 19 | <DebugType>pdbonly</DebugType> | |
@@ -23,7 +23,7 @@ | |||
| 23 | 23 | </PropertyGroup> | |
| 24 | 24 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'ReleaseMono|x64'"> | |
| 25 | 25 | <OutputPath>bin\x64\ReleaseMono\</OutputPath> | |
| 26 | - <DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON27, UCS4</DefineConstants> | ||
| 26 | + <DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON2;PYTHON27;UCS4</DefineConstants> | ||
| 27 | 27 | <AllowUnsafeBlocks>true</AllowUnsafeBlocks> | |
| 28 | 28 | <Optimize>true</Optimize> | |
| 29 | 29 | <DebugType>pdbonly</DebugType> | |
@@ -33,7 +33,7 @@ | |||
| 33 | 33 | </PropertyGroup> | |
| 34 | 34 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'ReleaseWin|x86'"> | |
| 35 | 35 | <OutputPath>bin\x86\ReleaseWin\</OutputPath> | |
| 36 | - <DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON27, UCS2</DefineConstants> | ||
| 36 | + <DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON2;PYTHON27;UCS2</DefineConstants> | ||
| 37 | 37 | <AllowUnsafeBlocks>true</AllowUnsafeBlocks> | |
| 38 | 38 | <Optimize>true</Optimize> | |
| 39 | 39 | <DebugType>pdbonly</DebugType> | |
@@ -43,7 +43,7 @@ | |||
| 43 | 43 | </PropertyGroup> | |
| 44 | 44 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'ReleaseWin|x64'"> | |
| 45 | 45 | <OutputPath>bin\x64\ReleaseWin\</OutputPath> | |
| 46 | - <DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON27, UCS2</DefineConstants> | ||
| 46 | + <DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON2;PYTHON27;UCS2</DefineConstants> | ||
| 47 | 47 | <AllowUnsafeBlocks>true</AllowUnsafeBlocks> | |
| 48 | 48 | <Optimize>true</Optimize> | |
| 49 | 49 | <DebugType>pdbonly</DebugType> | |
@@ -54,7 +54,7 @@ | |||
| 54 | 54 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'DebugMono|x86'"> | |
| 55 | 55 | <DebugSymbols>true</DebugSymbols> | |
| 56 | 56 | <OutputPath>bin\x86\DebugMono\</OutputPath> | |
| 57 | - <DefineConstants Condition="'$(DefineConstants)' == ''">TRACE;DEBUG;PYTHON27,UCS4</DefineConstants> | ||
| 57 | + <DefineConstants Condition="'$(DefineConstants)' == ''">TRACE;DEBUG;PYTHON2;PYTHON27;UCS4</DefineConstants> | ||
| 58 | 58 | <AllowUnsafeBlocks>true</AllowUnsafeBlocks> | |
| 59 | 59 | <Optimize>false</Optimize> | |
| 60 | 60 | <DebugType>full</DebugType> | |
@@ -66,7 +66,7 @@ | |||
| 66 | 66 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'DebugMono|x64'"> | |
| 67 | 67 | <DebugSymbols>true</DebugSymbols> | |
| 68 | 68 | <OutputPath>bin\x64\DebugMono\</OutputPath> | |
| 69 | - <DefineConstants Condition="'$(DefineConstants)' == ''">TRACE;DEBUG;PYTHON27,UCS4</DefineConstants> | ||
| 69 | + <DefineConstants Condition="'$(DefineConstants)' == ''">TRACE;DEBUG;PYTHON2;PYTHON27;UCS4</DefineConstants> | ||
| 70 | 70 | <AllowUnsafeBlocks>true</AllowUnsafeBlocks> | |
| 71 | 71 | <Optimize>false</Optimize> | |
| 72 | 72 | <DebugType>full</DebugType> | |
@@ -75,7 +75,7 @@ | |||
| 75 | 75 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'DebugWin|x86'"> | |
| 76 | 76 | <DebugSymbols>true</DebugSymbols> | |
| 77 | 77 | <OutputPath>bin\x86\DebugWin\</OutputPath> | |
| 78 | - <DefineConstants Condition="'$(DefineConstants)' == ''">TRACE;DEBUG;PYTHON27,UCS2</DefineConstants> | ||
| 78 | + <DefineConstants Condition="'$(DefineConstants)' == ''">TRACE;DEBUG;PYTHON2;PYTHON27;UCS2</DefineConstants> | ||
| 79 | 79 | <AllowUnsafeBlocks>true</AllowUnsafeBlocks> | |
| 80 | 80 | <Optimize>false</Optimize> | |
| 81 | 81 | <DebugType>full</DebugType> | |
@@ -87,7 +87,7 @@ | |||
| 87 | 87 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'DebugWin|x64'"> | |
| 88 | 88 | <DebugSymbols>true</DebugSymbols> | |
| 89 | 89 | <OutputPath>bin\x64\DebugWin\</OutputPath> | |
| 90 | - <DefineConstants Condition="'$(DefineConstants)' == ''">TRACE;DEBUG;PYTHON27,UCS2</DefineConstants> | ||
| 90 | + <DefineConstants Condition="'$(DefineConstants)' == ''">TRACE;DEBUG;PYTHON2;PYTHON27;UCS2</DefineConstants> | ||
| 91 | 91 | <AllowUnsafeBlocks>true</AllowUnsafeBlocks> | |
| 92 | 92 | <Optimize>false</Optimize> | |
| 93 | 93 | <DebugType>full</DebugType> | |
| Back | FazBrowse Home | New Git URL |
0 commit comments