aboutsummaryrefslogtreecommitdiff
path: root/X11/xtrans
diff options
context:
space:
mode:
Diffstat (limited to 'X11/xtrans')
-rw-r--r--X11/xtrans/Xtrans.c9
-rw-r--r--X11/xtrans/Xtranslcl.c6
-rw-r--r--X11/xtrans/Xtranssock.c16
3 files changed, 27 insertions, 4 deletions
diff --git a/X11/xtrans/Xtrans.c b/X11/xtrans/Xtrans.c
index d90a8cc1d..895b707f1 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
@@ -710,7 +715,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 ca04e7f03..8d579a5d8 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 5f65738b9..d6e8384e0 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
@@ -639,7 +647,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 */
@@ -724,7 +732,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 */
@@ -1251,7 +1259,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, 0);