libport: Avoid including winsock2.h.

This commit is contained in:
Alexandre Julliard 2008-12-24 10:05:19 +01:00
parent ae133b808f
commit 1399d14e0a
4 changed files with 20 additions and 9 deletions

2
configure vendored
View File

@ -7436,7 +7436,6 @@ done
for ac_header in \ for ac_header in \
@ -7552,7 +7551,6 @@ for ac_header in \
termios.h \ termios.h \
unistd.h \ unistd.h \
utime.h \ utime.h \
winsock2.h \
valgrind/memcheck.h \ valgrind/memcheck.h \
valgrind/valgrind.h valgrind/valgrind.h

View File

@ -351,7 +351,6 @@ AC_CHECK_HEADERS(\
termios.h \ termios.h \
unistd.h \ unistd.h \
utime.h \ utime.h \
winsock2.h \
valgrind/memcheck.h \ valgrind/memcheck.h \
valgrind/valgrind.h valgrind/valgrind.h
) )

View File

@ -966,9 +966,6 @@
/* Define to 1 if you have the `waitpid' function. */ /* Define to 1 if you have the `waitpid' function. */
#undef HAVE_WAITPID #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. */ /* Define to 1 if you have the <X11/extensions/shape.h> header file. */
#undef HAVE_X11_EXTENSIONS_SHAPE_H #undef HAVE_X11_EXTENSIONS_SHAPE_H

View File

@ -23,9 +23,6 @@
#ifndef HAVE_POLL #ifndef HAVE_POLL
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#ifdef HAVE_SYS_TIME_H #ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#endif #endif
@ -33,6 +30,26 @@
#include <unistd.h> #include <unistd.h>
#endif #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 ) int poll( struct pollfd *fds, unsigned int count, int timeout )
{ {
fd_set read_set, write_set, except_set; fd_set read_set, write_set, except_set;