Files
MINGW-packages/mingw-w64-python3/0360-MINGW-setup-select-module.patch
2016-07-12 14:49:26 +03:00

41 lines
1.6 KiB
Diff

diff -Naur Python-3.5.2-orig/Modules/selectmodule.c Python-3.5.2/Modules/selectmodule.c
--- Python-3.5.2-orig/Modules/selectmodule.c 2016-06-26 00:38:38.000000000 +0300
+++ Python-3.5.2/Modules/selectmodule.c 2016-07-12 14:21:18.701800700 +0300
@@ -102,9 +102,9 @@
v = PyObject_AsFileDescriptor( o );
if (v == -1) goto finally;
-#if defined(_MSC_VER)
+#if defined(MS_WIN32)
max = 0; /* not used for Win32 */
-#else /* !_MSC_VER */
+#else /* !MS_WIN32 */
if (!_PyIsSelectable_fd(v)) {
PyErr_SetString(PyExc_ValueError,
"filedescriptor out of range in select()");
@@ -112,7 +112,7 @@
}
if (v > max)
max = v;
-#endif /* _MSC_VER */
+#endif /* MS_WIN32 */
FD_SET(v, set);
/* add object and its file descriptor to the list */
diff -Naur Python-3.5.2-orig/setup.py Python-3.5.2/setup.py
--- Python-3.5.2-orig/setup.py 2016-07-12 14:21:18.450300700 +0300
+++ Python-3.5.2/setup.py 2016-07-12 14:21:18.715800700 +0300
@@ -681,7 +681,11 @@
missing.append('spwd')
# select(2); not on ancient System V
- exts.append( Extension('select', ['selectmodule.c']) )
+ select_libs = []
+ if host_platform.startswith(('mingw', 'win')):
+ select_libs += ['ws2_32']
+ exts.append( Extension('select', ['selectmodule.c'],
+ libraries=select_libs) )
# Fred Drake's interface to the Python parser
exts.append( Extension('parser', ['parsermodule.c']) )