| @@ -44,30 +44,33 @@ from The Open Group. | | | @@ -44,30 +44,33 @@ from The Open Group. |
44 | * DANIEL STONE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR | | 44 | * DANIEL STONE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR |
45 | * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER | | 45 | * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER |
46 | * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | | 46 | * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
47 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | | 47 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
48 | */ | | 48 | */ |
49 | | | 49 | |
50 | #ifndef _XPOLL_H_ | | 50 | #ifndef _XPOLL_H_ |
51 | #define _XPOLL_H_ | | 51 | #define _XPOLL_H_ |
52 | | | 52 | |
53 | #if !defined(WIN32) || defined(__CYGWIN__) | | 53 | #if !defined(WIN32) || defined(__CYGWIN__) |
54 | | | 54 | |
55 | #ifndef USE_POLL | | 55 | #ifndef USE_POLL |
56 | | | 56 | |
57 | #define XFD_SETSIZE 512 | | 57 | #if defined(FD_SETSIZE) && FD_SETSIZE < 512 |
58 | | | 58 | # define XFD_SETSIZE FD_SETSIZE |
59 | #ifndef FD_SETSIZE | | 59 | #else |
60 | #define FD_SETSIZE XFD_SETSIZE | | 60 | # define XFD_SETSIZE 512 |
| | | 61 | # ifndef FD_SETSIZE |
| | | 62 | # define FD_SETSIZE XFD_SETSIZE |
| | | 63 | # endif |
61 | #endif | | 64 | #endif |
62 | | | 65 | |
63 | #include <X11/Xos.h> | | 66 | #include <X11/Xos.h> |
64 | | | 67 | |
65 | #include <sys/select.h> /* Get the FD_* macros. */ | | 68 | #include <sys/select.h> /* Get the FD_* macros. */ |
66 | | | 69 | |
67 | #include <X11/Xmd.h> | | 70 | #include <X11/Xmd.h> |
68 | | | 71 | |
69 | #ifdef CSRG_BASED | | 72 | #ifdef CSRG_BASED |
70 | #include <sys/param.h> | | 73 | #include <sys/param.h> |
71 | # if BSD < 199103 | | 74 | # if BSD < 199103 |
72 | typedef long fd_mask; | | 75 | typedef long fd_mask; |
73 | # endif | | 76 | # endif |
| @@ -155,27 +158,27 @@ typedef struct fd_set { | | | @@ -155,27 +158,27 @@ typedef struct fd_set { |
155 | } | | 158 | } |
156 | #define XFD_UNSET(dst,b1) { \ | | 159 | #define XFD_UNSET(dst,b1) { \ |
157 | int __i__; \ | | 160 | int __i__; \ |
158 | for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \ | | 161 | for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \ |
159 | __XFDS_BITS((dst), __i__) &= ~(__XFDS_BITS((b1), __i__)); \ | | 162 | __XFDS_BITS((dst), __i__) &= ~(__XFDS_BITS((b1), __i__)); \ |
160 | } | | 163 | } |
161 | | | 164 | |
162 | #else /* USE_POLL */ | | 165 | #else /* USE_POLL */ |
163 | #include <sys/poll.h> | | 166 | #include <sys/poll.h> |
164 | #endif /* USE_POLL */ | | 167 | #endif /* USE_POLL */ |
165 | | | 168 | |
166 | #else /* WIN32 */ | | 169 | #else /* WIN32 */ |
167 | | | 170 | |
168 | #define XFD_SETSIZE 256 | | 171 | #define XFD_SETSIZE 512 |
169 | #ifndef FD_SETSIZE | | 172 | #ifndef FD_SETSIZE |
170 | #define FD_SETSIZE XFD_SETSIZE | | 173 | #define FD_SETSIZE XFD_SETSIZE |
171 | #endif | | 174 | #endif |
172 | #include <X11/Xwinsock.h> | | 175 | #include <X11/Xwinsock.h> |
173 | | | 176 | |
174 | #define Select(n,r,w,e,t) select(0,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t) | | 177 | #define Select(n,r,w,e,t) select(0,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t) |
175 | | | 178 | |
176 | #define XFD_SETCOUNT(p) (((fd_set FAR *)(p))->fd_count) | | 179 | #define XFD_SETCOUNT(p) (((fd_set FAR *)(p))->fd_count) |
177 | #define XFD_FD(p,i) (((fd_set FAR *)(p))->fd_array[i]) | | 180 | #define XFD_FD(p,i) (((fd_set FAR *)(p))->fd_array[i]) |
178 | #define XFD_ANYSET(p) XFD_SETCOUNT(p) | | 181 | #define XFD_ANYSET(p) XFD_SETCOUNT(p) |
179 | | | 182 | |
180 | #define XFD_COPYSET(src,dst) { \ | | 183 | #define XFD_COPYSET(src,dst) { \ |
181 | u_int __i; \ | | 184 | u_int __i; \ |