diff options
author | Steve Dower <steve.dower@microsoft.com> | 2014-11-22 12:54:57 -0800 |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2014-11-22 12:54:57 -0800 |
commit | 65e4cb10d9d9964f30bc72561bf0e86833328a3b (patch) | |
tree | 1c9502ea790480e2ea06b380d912eeb879b2f96d /Modules | |
parent | 92716777b862af05bf149bd02cac4d83234751c4 (diff) | |
download | cpython-git-65e4cb10d9d9964f30bc72561bf0e86833328a3b.tar.gz |
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')
-rw-r--r-- | Modules/posixmodule.c | 22 | ||||
-rw-r--r-- | Modules/socketmodule.c | 11 | ||||
-rw-r--r-- | Modules/timemodule.c | 13 |
3 files changed, 30 insertions, 16 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index bd7cd8ad48..d8e2441331 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1046,15 +1046,33 @@ PyLong_FromPy_off_t(Py_off_t offset) /* The actual size of the structure is determined at runtime. * Only the first items must be present. */ + +#if _MSC_VER >= 1900 + +typedef struct { + CRITICAL_SECTION lock; + intptr_t osfhnd; + __int64 startpos; + char osfile; +} my_ioinfo; + +#define IOINFO_L2E 6 +#define IOINFO_ARRAYS 128 + +#else + typedef struct { intptr_t osfhnd; char osfile; } my_ioinfo; -extern __declspec(dllimport) char * __pioinfo[]; #define IOINFO_L2E 5 -#define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E) #define IOINFO_ARRAYS 64 + +#endif + +extern __declspec(dllimport) char * __pioinfo[]; +#define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E) #define _NHANDLE_ (IOINFO_ARRAYS * IOINFO_ARRAY_ELTS) #define FOPEN 0x01 #define _NO_CONSOLE_FILENO (intptr_t)-2 diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 68bfeb4f19..94cf7738e4 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 diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 1f07bcc90f..7f5f3149af 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -34,10 +34,6 @@ static int floatsleep(double); static PyObject* floattime(_Py_clock_info_t *info); -#ifdef MS_WINDOWS -static OSVERSIONINFOEX winver; -#endif - static PyObject * time_time(PyObject *self, PyObject *unused) { @@ -1359,15 +1355,6 @@ PyInit_time(void) if (PyStructSequence_InitType2(&StructTimeType, &struct_time_type_desc) < 0) return NULL; - -#ifdef MS_WINDOWS - winver.dwOSVersionInfoSize = sizeof(winver); - if (!GetVersionEx((OSVERSIONINFO*)&winver)) { - Py_DECREF(m); - PyErr_SetFromWindowsErr(0); - return NULL; - } -#endif } Py_INCREF(&StructTimeType); #ifdef HAVE_STRUCT_TM_TM_ZONE |