Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(29)

Side by Side Diff: Modules/selectmodule.c

Issue 3871: cross and native build of python for mingw32 with distutils
Patch Set: Created 7 years, 2 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Modules/readline.c ('k') | Modules/Setup.config.in » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* select - Module containing unix select(2) call. 1 /* select - Module containing unix select(2) call.
2 Under Unix, the file descriptors are small integers. 2 Under Unix, the file descriptors are small integers.
3 Under Win32, select only exists for sockets, and sockets may 3 Under Win32, select only exists for sockets, and sockets may
4 have any value except INVALID_SOCKET. 4 have any value except INVALID_SOCKET.
5 */ 5 */
6 6
7 #include "Python.h" 7 #include "Python.h"
8 #include <structmember.h> 8 #include <structmember.h>
9 9
10 #ifdef HAVE_SYS_DEVPOLL_H 10 #ifdef HAVE_SYS_DEVPOLL_H
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 SOCKET v; 104 SOCKET v;
105 105
106 /* any intervening fileno() calls could decr this refcnt */ 106 /* any intervening fileno() calls could decr this refcnt */
107 if (!(o = PySequence_Fast_GET_ITEM(fast_seq, i))) 107 if (!(o = PySequence_Fast_GET_ITEM(fast_seq, i)))
108 goto finally; 108 goto finally;
109 109
110 Py_INCREF(o); 110 Py_INCREF(o);
111 v = PyObject_AsFileDescriptor( o ); 111 v = PyObject_AsFileDescriptor( o );
112 if (v == -1) goto finally; 112 if (v == -1) goto finally;
113 113
114 #if defined(_MSC_VER) 114 #if defined(MS_WIN32)
115 max = 0; /* not used for Win32 */ 115 max = 0; /* not used for Win32 */
116 #else /* !_MSC_VER */ 116 #else /* !MS_WIN32 */
117 if (!_PyIsSelectable_fd(v)) { 117 if (!_PyIsSelectable_fd(v)) {
118 PyErr_SetString(PyExc_ValueError, 118 PyErr_SetString(PyExc_ValueError,
119 "filedescriptor out of range in select()"); 119 "filedescriptor out of range in select()");
120 goto finally; 120 goto finally;
121 } 121 }
122 if (v > max) 122 if (v > max)
123 max = v; 123 max = v;
124 #endif /* _MSC_VER */ 124 #endif /* MS_WIN32 */
125 FD_SET(v, set); 125 FD_SET(v, set);
126 126
127 /* add object and its file descriptor to the list */ 127 /* add object and its file descriptor to the list */
128 if (index >= FD_SETSIZE) { 128 if (index >= FD_SETSIZE) {
129 PyErr_SetString(PyExc_ValueError, 129 PyErr_SetString(PyExc_ValueError,
130 "too many file descriptors in select()"); 130 "too many file descriptors in select()");
131 goto finally; 131 goto finally;
132 } 132 }
133 fd2obj[index].obj = o; 133 fd2obj[index].obj = o;
134 fd2obj[index].fd = v; 134 fd2obj[index].fd = v;
(...skipping 2148 matching lines...) Expand 10 before | Expand all | Expand 10 after
2283 /* NETDEV filter flags */ 2283 /* NETDEV filter flags */
2284 #ifdef EVFILT_NETDEV 2284 #ifdef EVFILT_NETDEV
2285 PyModule_AddIntConstant(m, "KQ_NOTE_LINKUP", NOTE_LINKUP); 2285 PyModule_AddIntConstant(m, "KQ_NOTE_LINKUP", NOTE_LINKUP);
2286 PyModule_AddIntConstant(m, "KQ_NOTE_LINKDOWN", NOTE_LINKDOWN); 2286 PyModule_AddIntConstant(m, "KQ_NOTE_LINKDOWN", NOTE_LINKDOWN);
2287 PyModule_AddIntConstant(m, "KQ_NOTE_LINKINV", NOTE_LINKINV); 2287 PyModule_AddIntConstant(m, "KQ_NOTE_LINKINV", NOTE_LINKINV);
2288 #endif 2288 #endif
2289 2289
2290 #endif /* HAVE_KQUEUE */ 2290 #endif /* HAVE_KQUEUE */
2291 return m; 2291 return m;
2292 } 2292 }
OLDNEW
« no previous file with comments | « Modules/readline.c ('k') | Modules/Setup.config.in » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+