Files
MINGW-packages/mingw-w64-python3/0360-MINGW-setup-select-module.patch
2013-12-27 11:17:12 +04:00

41 lines
1.5 KiB
Diff

diff -urN a/Modules/selectmodule.c b/Modules/selectmodule.c
--- a/Modules/selectmodule.c 2013-12-26 18:45:05.983762500 +0000
+++ b/Modules/selectmodule.c 2013-12-26 18:45:09.708975600 +0000
@@ -111,9 +111,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()");
@@ -121,7 +121,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 -urN a/setup.py b/setup.py
--- a/setup.py 2013-12-26 18:45:06.530793800 +0000
+++ b/setup.py 2013-12-26 18:45:09.710975700 +0000
@@ -618,7 +618,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']) )