]> granicus.if.org Git - python/commitdiff
bpo-32282: Remove unnecessary check for `VersionHelpers.h` in `socketmodule.c` on...
authorMax Bélanger <aeromax@gmail.com>
Sun, 7 Jan 2018 02:05:18 +0000 (18:05 -0800)
committerSteve Dower <steve.dower@microsoft.com>
Sun, 7 Jan 2018 02:05:18 +0000 (13:05 +1100)
Misc/NEWS.d/next/Core and Builtins/2017-12-12-14-02-28.bpo-32282.xFVMTn.rst [new file with mode: 0644]
Modules/socketmodule.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2017-12-12-14-02-28.bpo-32282.xFVMTn.rst b/Misc/NEWS.d/next/Core and Builtins/2017-12-12-14-02-28.bpo-32282.xFVMTn.rst
new file mode 100644 (file)
index 0000000..1c833c5
--- /dev/null
@@ -0,0 +1,2 @@
+Fix an unnecessary ifdef in the include of VersionHelpers.h in socketmodule
+on Windows.
index d52d9db743a67ff59c6e676e7ee7f303675408a6..d75a51af9a6a9eb602cd987d3427323fb16b35e5 100644 (file)
@@ -297,10 +297,8 @@ http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/net/getaddrinfo.c.diff?r1=1.82&
 #  include <fcntl.h>
 # endif
 
-#if defined(_MSC_VER) && _MSC_VER >= 1800
 /* Provides the IsWindows7SP1OrGreater() function */
 #include <VersionHelpers.h>
-#endif
 
 #endif
 
@@ -6552,15 +6550,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