File tree Expand file tree Collapse file tree 4 files changed +20
-6
lines changed
Expand file tree Collapse file tree 4 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,12 @@ forgotten) from the programmer.
1212#include "windows.h"
1313
1414#ifdef Py_ENABLE_SHARED
15+ #ifdef MS_DLL_ID
16+ // The string is available at build, so fill the buffer immediately
17+ char dllVersionBuffer [16 ] = MS_DLL_ID ;
18+ #else
1519char dllVersionBuffer [16 ] = "" ; // a private buffer
20+ #endif
1621
1722// Python Globals
1823HMODULE PyWin_DLLhModule = NULL ;
@@ -88,8 +93,11 @@ BOOL WINAPI DllMain (HANDLE hInst,
8893 {
8994 case DLL_PROCESS_ATTACH :
9095 PyWin_DLLhModule = hInst ;
96+ #ifndef MS_DLL_ID
97+ // If we have MS_DLL_ID, we don't need to load the string.
9198 // 1000 is a magic number I picked out of the air. Could do with a #define, I spose...
9299 LoadString (hInst , 1000 , dllVersionBuffer , sizeof (dllVersionBuffer ));
100+ #endif
93101
94102#if HAVE_SXS
95103 // and capture our activation context for use when loading extensions.
Original file line number Diff line number Diff line change 8787 <WriteLinesToFile File =" $(PySourcePath)PC\pythonnt_rc$(PyDebugExt).h" Overwrite =" true" Encoding =" ascii"
8888 Lines =' /* This file created by python.props /t:GeneratePythonNtRcH */
8989#define FIELD3 $(Field3Value)
90- #define MS_DLL_ID "$(PythonMajorVersion).$(PythonMinorVersion )"
90+ #define MS_DLL_ID "$(SysWinVer )"
9191#define PYTHON_DLL_NAME "$(PyDllName).dll"
9292' />
9393 <ItemGroup >
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
2- <Project ToolsVersion =" 4.0" xmlns =" http://schemas.microsoft.com/developer/msbuild/2003" >
2+ <Project ToolsVersion =" 4.0" xmlns =" http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty = " Platform " >
33 <PropertyGroup >
4- <Platform Condition =" '$(Platform)' == ''" >Win32</Platform >
4+ <Platform Condition =" '$(Platform)' == '' or '$(Platform)' == 'x86' " >Win32</Platform >
55 <Configuration Condition =" '$(Configuration)' == ''" >Release</Configuration >
66 <!--
77 Use the latest available version of Visual Studio to build. To override
100100 <!-- The version and platform tag to include in .pyd filenames -->
101101 <PydTag Condition =" $(Platform) == 'Win32'" >.cp$(MajorVersionNumber)$(MinorVersionNumber)-win32</PydTag >
102102 <PydTag Condition =" $(Platform) == 'x64'" >.cp$(MajorVersionNumber)$(MinorVersionNumber)-win_amd64</PydTag >
103+
104+ <!-- The version number for sys.winver -->
105+ <SysWinVer >$(MajorVersionNumber).$(MinorVersionNumber)</SysWinVer >
106+ <SysWinVer Condition =" $(Platform) == 'Win32'" >$(SysWinVer)-32</SysWinVer >
103107 </PropertyGroup >
104108
105109 <!-- Displays the calculated version info -->
Original file line number Diff line number Diff line change 6767 <ClCompile >
6868 <AdditionalOptions >/Zm200 %(AdditionalOptions)</AdditionalOptions >
6969 <AdditionalIncludeDirectories >$(PySourcePath)Python;$(PySourcePath)Modules\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories >
70- <PreprocessorDefinitions >_USRDLL;Py_BUILD_CORE;Py_ENABLE_SHARED;%(PreprocessorDefinitions)</PreprocessorDefinitions >
70+ <PreprocessorDefinitions >_USRDLL;Py_BUILD_CORE;Py_ENABLE_SHARED;MS_DLL_ID="$(SysWinVer)"; %(PreprocessorDefinitions)</PreprocessorDefinitions >
7171 </ClCompile >
7272 <Link >
7373 <AdditionalDependencies >ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies >
335335 <ClCompile Include =" ..\Parser\tokenizer.c" />
336336 <ClCompile Include =" ..\PC\winreg.c" />
337337 <ClCompile Include =" ..\PC\config.c" />
338- <ClCompile Include =" ..\PC\dl_nt.c" />
339338 <ClCompile Include =" ..\PC\getpathp.c" />
340339 <ClCompile Include =" ..\PC\msvcrtmodule.c" />
341340 <ClCompile Include =" ..\Python\pyhash.c" />
386385 <ClCompile Include =" ..\Python\thread.c" />
387386 <ClCompile Include =" ..\Python\traceback.c" />
388387 </ItemGroup >
388+ <ItemGroup >
389+ <ClCompile Include =" ..\PC\dl_nt.c" />
390+ </ItemGroup >
389391 <ItemGroup >
390392 <ResourceCompile Include =" ..\PC\python_nt.rc" />
391393 </ItemGroup >
392394 <Import Project =" $(VCTargetsPath)\Microsoft.Cpp.targets" />
393395 <ImportGroup Label =" ExtensionTargets" >
394396 </ImportGroup >
395397
396- <Target Name =" _GetBuildInfo" AfterTargets =" PrepareForBuild" >
398+ <Target Name =" _GetBuildInfo" BeforeTargets =" PrepareForBuild" >
397399 <Exec Command =' hg id -b > "$(IntDir)hgbranch.txt"' ContinueOnError =" true" />
398400 <Exec Command =' hg id -i > "$(IntDir)hgversion.txt"' ContinueOnError =" true" />
399401 <Exec Command =' hg id -t > "$(IntDir)hgtag.txt"' ContinueOnError =" true" />
You can’t perform that action at this time.
0 commit comments