diff options
Diffstat (limited to 'lib/select.h')
-rw-r--r-- | lib/select.h | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/lib/select.h b/lib/select.h index e0844b1d6..c5a9c1059 100644 --- a/lib/select.h +++ b/lib/select.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -23,13 +23,30 @@ * $Id$ ***************************************************************************/ +#include "setup.h" + #ifdef HAVE_SYS_POLL_H #include <sys/poll.h> -#elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0600) -/* for Vista, use WSAPoll(). */ -#include <winsock2.h> -#define CURL_HAVE_WSAPOLL -#else +#endif + +/* + * poll() function on Windows Vista and later is called WSAPoll() + */ + +#if defined(USE_WINSOCK) && (USE_WINSOCK > 1) && \ + defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0600) +#undef HAVE_POLL +#define HAVE_POLL 1 +#undef HAVE_POLL_FINE +#define HAVE_POLL_FINE 1 +#define poll(x,y,z) WSAPoll((x),(y),(z)) +#endif + +/* + * Definition of pollfd struct and constants for platforms lacking them. + */ + +#ifndef HAVE_POLL #define POLLIN 0x01 #define POLLPRI 0x02 @@ -60,4 +77,4 @@ int tpf_select_libcurl(int maxfds, fd_set* reads, fd_set* writes, fd_set* excepts, struct timeval* tv); #endif -#endif +#endif /* __SELECT_H */ |