diff options
Diffstat (limited to 'X11/xtrans/Xtranssock.c')
-rw-r--r-- | X11/xtrans/Xtranssock.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/X11/xtrans/Xtranssock.c b/X11/xtrans/Xtranssock.c index dfa41cfe9..3a151ecfe 100644 --- a/X11/xtrans/Xtranssock.c +++ b/X11/xtrans/Xtranssock.c @@ -129,11 +129,15 @@ from the copyright holders. #include <X11/Xw32defs.h> #undef close #define close closesocket +#undef ECONNREFUSED #define ECONNREFUSED WSAECONNREFUSED +#undef EADDRINUSE #define EADDRINUSE WSAEADDRINUSE +#undef EPROTOTYPE #define EPROTOTYPE WSAEPROTOTYPE #undef EWOULDBLOCK #define EWOULDBLOCK WSAEWOULDBLOCK +#undef EINPROGRESS #define EINPROGRESS WSAEINPROGRESS #undef EINTR #define EINTR WSAEINTR @@ -242,7 +246,11 @@ static int TRANS(SocketINETClose) (XtransConnInfo ciptr); #endif #if defined HAVE_SOCKLEN_T || (defined(IPv6) && defined(AF_INET6)) +#ifdef _MSC_VER +# define SOCKLEN_T int +#else # define SOCKLEN_T socklen_t +#endif #elif defined(SVR4) || defined(__SVR4) || defined(__SCO__) # define SOCKLEN_T size_t #else @@ -640,7 +648,7 @@ TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, char *protocol, if (Sockettrans2devtab[i].family == AF_INET6) { int one = 1; - setsockopt(ciptr->fd, IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(int)); + setsockopt(ciptr->fd, IPPROTO_IPV6, IPV6_V6ONLY, (const char *)&one, sizeof(int)); } #endif /* Save the index for later use */ @@ -725,7 +733,7 @@ TRANS(SocketOpenCLTSServer) (Xtransport *thistrans, char *protocol, if (Sockettrans2devtab[i].family == AF_INET6) { int one = 1; - setsockopt(ciptr->fd, IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(int)); + setsockopt(ciptr->fd, IPPROTO_IPV6, IPV6_V6ONLY, (const char *)&one, sizeof(int)); } #endif /* Save the index for later use */ @@ -1247,7 +1255,11 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status) { XtransConnInfo newciptr; +#if defined(IPv6) && defined(AF_INET6) + struct sockaddr_storage sockname; +#else struct sockaddr_in sockname; +#endif SOCKLEN_T namelen = sizeof(sockname); prmsg (2, "SocketINETAccept(%p,%d)\n", ciptr, ciptr->fd); |