diff options
Diffstat (limited to 'X11/xtrans')
-rw-r--r-- | X11/xtrans/Xtrans.c | 9 | ||||
-rw-r--r-- | X11/xtrans/Xtranslcl.c | 6 | ||||
-rw-r--r-- | X11/xtrans/Xtranssock.c | 16 |
3 files changed, 27 insertions, 4 deletions
diff --git a/X11/xtrans/Xtrans.c b/X11/xtrans/Xtrans.c index 522e543c4..f90bd47e8 100644 --- a/X11/xtrans/Xtrans.c +++ b/X11/xtrans/Xtrans.c @@ -48,7 +48,11 @@ from The Open Group. */ #include <ctype.h> +#include <unistd.h> +#ifdef _MSC_VER +#include <X11\Xwinsock.h> +#endif /* * The transport table contains a definition for every transport (protocol) * family. All operations that can be made on the transport go through this @@ -113,9 +117,10 @@ Xtransport_table Xtransports[] = { { &TRANS(SCOFuncs), TRANS_LOCAL_SCO_INDEX }, #endif /* __SCO__ || __UNIXWARE__ */ #endif /* LOCALCONN */ + { NULL, 0} }; -#define NUMTRANS (sizeof(Xtransports)/sizeof(Xtransport_table)) +#define NUMTRANS (sizeof(Xtransports)/sizeof(Xtransport_table)-1) #ifdef WIN32 @@ -711,7 +716,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg) #if defined(WIN32) { #ifdef WIN32 - u_long arg; + unsigned long arg; #else int arg; #endif diff --git a/X11/xtrans/Xtranslcl.c b/X11/xtrans/Xtranslcl.c index 8466ddc4c..ddc5a3e81 100644 --- a/X11/xtrans/Xtranslcl.c +++ b/X11/xtrans/Xtranslcl.c @@ -72,17 +72,23 @@ from The Open Group. #include <errno.h> #include <ctype.h> +#ifdef _MSC_VER +#include <signal.h> +#else #include <sys/signal.h> #include <sys/ioctl.h> +#endif #include <sys/stat.h> #if defined(SVR4) || defined(__SVR4) #include <sys/filio.h> #endif +#ifndef _MSC_VER #ifdef sun # include <stropts.h> #else # include <sys/stropts.h> #endif +#endif #include <sys/wait.h> #include <sys/types.h> diff --git a/X11/xtrans/Xtranssock.c b/X11/xtrans/Xtranssock.c index 955516db3..dff33f323 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 @@ -637,7 +645,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 */ @@ -722,7 +730,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 */ @@ -1244,7 +1252,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); |