Commit 1399d14e authored by Alexandre Julliard's avatar Alexandre Julliard

libport: Avoid including winsock2.h.

parent ae133b80
......@@ -7438,7 +7438,6 @@ done
for ac_header in \
AudioUnit/AudioUnit.h \
Carbon/Carbon.h \
......@@ -7552,7 +7551,6 @@ for ac_header in \
termios.h \
unistd.h \
utime.h \
winsock2.h \
valgrind/memcheck.h \
valgrind/valgrind.h
......
......@@ -351,7 +351,6 @@ AC_CHECK_HEADERS(\
termios.h \
unistd.h \
utime.h \
winsock2.h \
valgrind/memcheck.h \
valgrind/valgrind.h
)
......
......@@ -966,9 +966,6 @@
/* Define to 1 if you have the `waitpid' function. */
#undef HAVE_WAITPID
/* Define to 1 if you have the <winsock2.h> header file. */
#undef HAVE_WINSOCK2_H
/* Define to 1 if you have the <X11/extensions/shape.h> header file. */
#undef HAVE_X11_EXTENSIONS_SHAPE_H
......
......@@ -23,9 +23,6 @@
#ifndef HAVE_POLL
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
......@@ -33,6 +30,26 @@
#include <unistd.h>
#endif
/* we can't include winsock2.h here so we have to duplicate the definitions for Windows */
#if defined(__MINGW32__) || defined(_MSC_VER)
#define FD_SETSIZE 64
typedef struct
{
unsigned int fd_count;
int fd_array[FD_SETSIZE]; /* an array of SOCKETs */
} fd_set;
#define FD_ZERO(set) ((set)->fd_count = 0)
#define FD_ISSET(fd, set) __WSAFDIsSet((fd), (set))
#define FD_SET(fd, set) do { if ((set)->fd_count < FD_SETSIZE) (set)->fd_array[(set)->fd_count++]=(fd); } while(0)
int __stdcall select(int,fd_set*,fd_set*,fd_set*,const struct timeval*);
int __stdcall __WSAFDIsSet(int,fd_set*);
#endif
int poll( struct pollfd *fds, unsigned int count, int timeout )
{
fd_set read_set, write_set, except_set;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment