diff options
author | Steve Dower <steve.dower@microsoft.com> | 2014-11-22 20:54:57 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2014-11-22 20:54:57 (GMT) |
commit | 65e4cb10d9d9964f30bc72561bf0e86833328a3b (patch) | |
tree | 1c9502ea790480e2ea06b380d912eeb879b2f96d /Modules/socketmodule.c | |
parent | 92716777b862af05bf149bd02cac4d83234751c4 (diff) | |
download | cpython-65e4cb10d9d9964f30bc72561bf0e86833328a3b.zip cpython-65e4cb10d9d9964f30bc72561bf0e86833328a3b.tar.gz cpython-65e4cb10d9d9964f30bc72561bf0e86833328a3b.tar.bz2 |
Issue #22919: Windows build updated to support VC 14.0 (Visual Studio 2015), which will be used for the official 3.5 release.
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r-- | Modules/socketmodule.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 68bfeb4..94cf773 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -284,6 +284,11 @@ 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 + #endif #include <stddef.h> @@ -5845,11 +5850,15 @@ 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 && minor >= 1); + support_wsa_no_inherit = major > 6 || (major == 6 && minor >= 1); +#endif } #endif |