Rob Shearman : rpcrt4: Include ws2tcpip. h instead of Unix headers when targeting a build for Windows.

Alexandre Julliard julliard at winehq.org
Mon Feb 25 06:51:42 CST 2008


Module: wine
Branch: master
Commit: 02872894753200f40414fd7db0223628b1c808aa
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=02872894753200f40414fd7db0223628b1c808aa

Author: Rob Shearman <rob at codeweavers.com>
Date:   Sat Feb 23 13:21:21 2008 +0000

rpcrt4: Include ws2tcpip.h instead of Unix headers when targeting a build for Windows.

---

 dlls/rpcrt4/rpc_transport.c |   58 +++++++++++++++++++++++++-----------------
 1 files changed, 34 insertions(+), 24 deletions(-)

diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c
index e3fd8c1..0859537 100644
--- a/dlls/rpcrt4/rpc_transport.c
+++ b/dlls/rpcrt4/rpc_transport.c
@@ -29,32 +29,42 @@
 #include <stdio.h>
 #include <string.h>
 #include <assert.h>
-#include <errno.h>
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#include <fcntl.h>
 #include <stdlib.h>
 #include <sys/types.h>
-#ifdef HAVE_SYS_SOCKET_H
-# include <sys/socket.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_NETINET_TCP_H
-# include <netinet/tcp.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#ifdef HAVE_SYS_POLL_H
-#include <sys/poll.h>
-#endif
+
+#if defined(__MINGW32__) || defined (_MSC_VER)
+# include <ws2tcpip.h>
+# ifndef EADDRINUSE
+#  define EADDRINUSE WSAEADDRINUSE
+# endif
+# ifndef EAGAIN
+#  define EAGAIN WSAEWOULDBLOCK
+# endif
+#else
+# include <errno.h>
+# ifdef HAVE_UNISTD_H
+#  include <unistd.h>
+# endif
+# include <fcntl.h>
+# ifdef HAVE_SYS_SOCKET_H
+#  include <sys/socket.h>
+# endif
+# ifdef HAVE_NETINET_IN_H
+#  include <netinet/in.h>
+# endif
+# ifdef HAVE_NETINET_TCP_H
+#  include <netinet/tcp.h>
+# endif
+# ifdef HAVE_ARPA_INET_H
+#  include <arpa/inet.h>
+# endif
+# ifdef HAVE_NETDB_H
+#  include <netdb.h>
+# endif
+# ifdef HAVE_SYS_POLL_H
+#  include <sys/poll.h>
+# endif
+#endif /* defined(__MINGW32__) || defined (_MSC_VER) */
 
 #include "windef.h"
 #include "winbase.h"




More information about the wine-cvs mailing list