aboutsummaryrefslogtreecommitdiff
path: root/X11/xtrans
diff options
context:
space:
mode:
Diffstat (limited to 'X11/xtrans')
-rw-r--r--X11/xtrans/Xtrans.c8
-rw-r--r--X11/xtrans/Xtranssock.c8
2 files changed, 14 insertions, 2 deletions
diff --git a/X11/xtrans/Xtrans.c b/X11/xtrans/Xtrans.c
index f59bd61fa..e86b6c645 100644
--- a/X11/xtrans/Xtrans.c
+++ b/X11/xtrans/Xtrans.c
@@ -49,6 +49,9 @@ from The Open Group.
#include <ctype.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 +116,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
@@ -726,7 +730,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/Xtranssock.c b/X11/xtrans/Xtranssock.c
index 5f65738b9..a17c162e9 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