From 418683f5377d7bcb751888345ba14a77fd68cdbd Mon Sep 17 00:00:00 2001
From: Gisle Vanem <gvanem@broadpark.no>
Date: Tue, 16 Dec 2008 08:25:55 +0000
Subject: [PATCH] Added the use of Watt-32 tcp/ip stack for Win32 targets.

---
 lib/config-win32.h | 24 ++++++++++++++++++++++++
 lib/connect.c      |  4 ----
 lib/ftp.c          |  2 --
 3 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/lib/config-win32.h b/lib/config-win32.h
index dc359d6a38..eab2874cd1 100644
--- a/lib/config-win32.h
+++ b/lib/config-win32.h
@@ -343,6 +343,30 @@
 /* Define this if you have struct timeval */
 #define HAVE_STRUCT_TIMEVAL 1
 
+/* ---------------------------------------------------------------- */
+/*                        Watt-32 tcp/ip SPECIFIC                   */
+/* ---------------------------------------------------------------- */
+
+#ifdef USE_WATT32
+  #include <tcp.h>
+  #undef byte
+  #undef word
+  #undef USE_WINSOCK
+  #undef HAVE_WINSOCK_H
+  #undef HAVE_WINSOCK2_H
+  #undef HAVE_WS2TCPIP_H
+  #define HAVE_GETADDRINFO
+  #define HAVE_GETNAMEINFO
+  #define HAVE_SYS_IOCTL_H
+  #define HAVE_SYS_SOCKET_H
+  #define HAVE_NETINET_IN_H
+  #define HAVE_NETDB_H
+  #define HAVE_ARPA_INET_H
+  #define HAVE_FREEADDRINFO
+  #define SOCKET int
+#endif
+
+
 /* ---------------------------------------------------------------- */
 /*                        COMPILER SPECIFIC                         */
 /* ---------------------------------------------------------------- */
diff --git a/lib/connect.c b/lib/connect.c
index 30cd1535bd..569142d3ef 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -23,8 +23,6 @@
 
 #include "setup.h"
 
-#ifndef WIN32
-/* headers for non-win32 */
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
@@ -71,8 +69,6 @@
 #include <inet.h>
 #endif
 
-#endif  /* !WIN32 */
-
 #include <stdio.h>
 #include <errno.h>
 #include <string.h>
diff --git a/lib/ftp.c b/lib/ftp.c
index 7f17cc1118..4b0c536cde 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -34,7 +34,6 @@
 #include <unistd.h>
 #endif
 
-#ifndef WIN32
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
@@ -54,7 +53,6 @@
 #include <in.h>
 #include <inet.h>
 #endif
-#endif  /* !WIN32 */
 
 #if (defined(NETWARE) && defined(__NOVELL_LIBC__))
 #undef in_addr_t
-- 
GitLab