diff options
Diffstat (limited to 'X11/xtrans')
-rw-r--r-- | X11/xtrans/Xtrans.c | 9 | ||||
-rw-r--r-- | X11/xtrans/Xtransint.h | 5 | ||||
-rw-r--r-- | X11/xtrans/Xtranslcl.c | 6 | ||||
-rw-r--r-- | X11/xtrans/Xtranssock.c | 16 |
4 files changed, 32 insertions, 4 deletions
diff --git a/X11/xtrans/Xtrans.c b/X11/xtrans/Xtrans.c index 54e3bdca7..1f37c4341 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 @@ -700,7 +705,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/Xtransint.h b/X11/xtrans/Xtransint.h index 3bce8dc6b..9954dfe06 100644 --- a/X11/xtrans/Xtransint.h +++ b/X11/xtrans/Xtransint.h @@ -388,6 +388,11 @@ static int trans_mkdir ( # if defined(XSERV_t) && defined(TRANS_SERVER) # include "os.h" # else + +#ifdef _MSC_VER +#define inline __inline +#endif + static inline void _X_ATTRIBUTE_PRINTF(1, 0) VErrorF(const char *f, va_list args) { diff --git a/X11/xtrans/Xtranslcl.c b/X11/xtrans/Xtranslcl.c index 5beef7c98..242e07af1 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 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); |