From 658b65ad0cc2045bf2c930c8ef2a2853a07ba6ee Mon Sep 17 00:00:00 2001 From: dscho Date: Wed, 1 Dec 2004 23:06:56 +0000 Subject: support MinGW32! --- libvncserver/sockets.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'libvncserver/sockets.c') diff --git a/libvncserver/sockets.c b/libvncserver/sockets.c index 5ded1c7..0937097 100755 --- a/libvncserver/sockets.c +++ b/libvncserver/sockets.c @@ -45,14 +45,6 @@ #include #endif -#ifdef WIN32 -#pragma warning (disable: 4018 4761) -#define close closesocket -#define read(sock,buf,len) recv(sock,buf,len,0) -#define EWOULDBLOCK WSAEWOULDBLOCK -#define ETIMEDOUT WSAETIMEDOUT -#define write(sock,buf,len) send(sock,buf,len,0) -#else #ifdef LIBVNCSERVER_HAVE_SYS_TIME_H #include #endif @@ -68,7 +60,6 @@ #ifdef LIBVNCSERVER_HAVE_UNISTD_H #include #endif -#endif #if defined(__linux__) && defined(NEED_TIMEVAL) struct timeval @@ -91,10 +82,14 @@ int allow_severity=LOG_INFO; int deny_severity=LOG_WARNING; #endif -/*#ifndef WIN32 -int max(int i,int j) { return(iscreen->maxFd>0 && !FD_ISSET(cl->screen->maxFd,&(cl->screen->allFds))) cl->screen->maxFd--; +#ifndef __MINGW32__ shutdown(cl->sock,SHUT_RDWR); +#endif close(cl->sock); cl->sock = -1; } @@ -414,7 +411,7 @@ rfbReadExactTimeout(rfbClientPtr cl, char* buf, int len, int timeout) } else { #ifdef WIN32 - errno = WSAGetLastError(); + errno = WSAGetLastError(); #endif if (errno == EINTR) continue; -- cgit v1.2.3