From 2587952f2fc4abb3adf6a838bf8a1fc3997c81be Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Thu, 15 Jan 2015 09:10:16 -0800 Subject: Fixes sys.winver generation and removes dependency on user32.dll --- PC/dl_nt.c | 8 ++++++++ PCbuild/pyproject.props | 2 +- PCbuild/python.props | 8 ++++++-- PCbuild/pythoncore.vcxproj | 8 +++++--- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/PC/dl_nt.c b/PC/dl_nt.c index ae10fb5..c87c51e 100644 --- a/PC/dl_nt.c +++ b/PC/dl_nt.c @@ -12,7 +12,12 @@ forgotten) from the programmer. #include "windows.h" #ifdef Py_ENABLE_SHARED +#ifdef MS_DLL_ID +// The string is available at build, so fill the buffer immediately +char dllVersionBuffer[16] = MS_DLL_ID; +#else char dllVersionBuffer[16] = ""; // a private buffer +#endif // Python Globals HMODULE PyWin_DLLhModule = NULL; @@ -88,8 +93,11 @@ BOOL WINAPI DllMain (HANDLE hInst, { case DLL_PROCESS_ATTACH: PyWin_DLLhModule = hInst; +#ifndef MS_DLL_ID + // If we have MS_DLL_ID, we don't need to load the string. // 1000 is a magic number I picked out of the air. Could do with a #define, I spose... LoadString(hInst, 1000, dllVersionBuffer, sizeof(dllVersionBuffer)); +#endif #if HAVE_SXS // and capture our activation context for use when loading extensions. diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index 85aebeb..33570d7 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -87,7 +87,7 @@ diff --git a/PCbuild/python.props b/PCbuild/python.props index 99eebf0..788df56 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -1,7 +1,7 @@ - + - Win32 + Win32 Release .cp$(MajorVersionNumber)$(MinorVersionNumber)-win32 .cp$(MajorVersionNumber)$(MinorVersionNumber)-win_amd64 + + + $(MajorVersionNumber).$(MinorVersionNumber) + $(SysWinVer)-32 diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 4ecfd10..479f68d 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -67,7 +67,7 @@ /Zm200 %(AdditionalOptions) $(PySourcePath)Python;$(PySourcePath)Modules\zlib;%(AdditionalIncludeDirectories) - _USRDLL;Py_BUILD_CORE;Py_ENABLE_SHARED;%(PreprocessorDefinitions) + _USRDLL;Py_BUILD_CORE;Py_ENABLE_SHARED;MS_DLL_ID="$(SysWinVer)";%(PreprocessorDefinitions) ws2_32.lib;%(AdditionalDependencies) @@ -335,7 +335,6 @@ - @@ -387,13 +386,16 @@ + + + - + -- cgit v0.12