mirror of
https://github.com/python/cpython.git
synced 2026-05-07 02:51:00 +00:00
bpo-32282: Remove unnecessary check for VersionHelpers.h in socketmodule.c on Windows (GH-5120)
(cherry picked from commit af11a15c58)
This commit is contained in:
parent
e6e440ad5c
commit
09eb6fe8fd
2 changed files with 2 additions and 10 deletions
|
|
@ -0,0 +1,2 @@
|
|||
Fix an unnecessary ifdef in the include of VersionHelpers.h in socketmodule
|
||||
on Windows.
|
||||
|
|
@ -312,10 +312,8 @@ if_indextoname(index) -- return the corresponding interface name\n\
|
|||
# include <fcntl.h>
|
||||
# endif
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1800
|
||||
/* Provides the IsWindows7SP1OrGreater() function */
|
||||
#include <VersionHelpers.h>
|
||||
#endif
|
||||
|
||||
/* remove some flags on older version Windows during run-time.
|
||||
https://msdn.microsoft.com/en-us/library/windows/desktop/ms738596.aspx */
|
||||
|
|
@ -6571,15 +6569,7 @@ PyInit__socket(void)
|
|||
|
||||
#ifdef MS_WINDOWS
|
||||
if (support_wsa_no_inherit == -1) {
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1800
|
||||
support_wsa_no_inherit = IsWindows7SP1OrGreater();
|
||||
#else
|
||||
DWORD version = GetVersion();
|
||||
DWORD major = (DWORD)LOBYTE(LOWORD(version));
|
||||
DWORD minor = (DWORD)HIBYTE(LOWORD(version));
|
||||
/* need Windows 7 SP1, 2008 R2 SP1 or later */
|
||||
support_wsa_no_inherit = major > 6 || (major == 6 && minor >= 1);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue