From 749f5387c19449209615b282ac738032f2a890e7 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 14 Oct 2003 12:00:45 +0000 Subject: [PATCH] Gisle Vanem's IPv6-on-Windows patch applied! --- lib/config-win32.h | 26 ++++++++++++++++++++------ lib/connect.c | 2 +- lib/dict.c | 1 - lib/easy.c | 1 - lib/file.c | 1 - lib/ftp.c | 2 +- lib/hostip.c | 2 +- lib/http.c | 1 - lib/inet_pton.c | 10 ++++------ lib/memdebug.c | 4 ---- lib/memdebug.h | 3 --- lib/progress.c | 6 ------ lib/sendf.c | 3 --- lib/setup.h | 11 +++++++++++ lib/speedcheck.c | 3 --- lib/telnet.c | 3 +-- lib/timeval.c | 5 ++--- lib/timeval.h | 1 - lib/transfer.c | 1 - lib/url.c | 1 - 20 files changed, 41 insertions(+), 46 deletions(-) diff --git a/lib/config-win32.h b/lib/config-win32.h index 1e0622941..c24e8b7b6 100644 --- a/lib/config-win32.h +++ b/lib/config-win32.h @@ -27,7 +27,9 @@ #define ssize_t int /* Define this to 'int' if socklen_t is not an available typedefed type */ +#if !defined(ENABLE_IPV6) && !defined(USE_SSLEAY) #define socklen_t int +#endif /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -98,6 +100,9 @@ /* Define if you have the uname function. */ /*#define HAVE_UNAME 1*/ +/* Define if you have utime() */ +#define HAVE_UTIME 1 + /* Define if you have the header file. */ /*#define HAVE_ALLOCA_H 1*/ @@ -105,7 +110,7 @@ #define HAVE_MALLOC_H 1 /* Define if you have the header file. */ -#define HAVE_ARPA_INET_H 1 +/* #define HAVE_ARPA_INET_H 1 */ /* Define if you have the header file. */ /* #undef HAVE_CRYPTO_H */ @@ -123,7 +128,7 @@ /* #undef HAVE_GETOPT_H */ /* Define if you have the header file. */ -#define HAVE_NETDB_H 1 +/* #define HAVE_NETDB_H 1 */ /* Define if you have the header file. */ /*#define HAVE_NETINET_IN_H 1*/ @@ -144,19 +149,22 @@ /*#define HAVE_SYS_SOCKET_H 1*/ /* Define if you have the header file. */ -#define HAVE_SYS_SOCKIO_H 1 +/* #define HAVE_SYS_SOCKIO_H 1 */ /* Define if you have the header file. */ #define HAVE_SYS_STAT_H 1 +/* Define if you have the header file */ +#define HAVE_SYS_UTIME_H 1 + /* Define if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define if you have the header file. */ -#define HAVE_TERMIO_H 1 +/* #define HAVE_TERMIO_H 1 */ /* Define if you have the header file. */ -#define HAVE_TERMIOS_H 1 +/* #define HAVE_TERMIOS_H 1 */ /* Name of package */ #define PACKAGE "curl" @@ -170,6 +178,12 @@ /* Define if you have the header file. */ #define HAVE_WINSOCK_H 1 +/* Define if you have the header file. */ +#define HAVE_WINSOCK2_H 1 + +/* Define if you have the header file. */ +#define HAVE_WS2TCPIP_H 1 + /* Define if you have the header file. */ #define HAVE_STDLIB_H 1 @@ -191,7 +205,7 @@ /************************************************* * This section is for compiler specific defines.* *************************************************/ -#ifdef MINGW32 /* Borland and MS don't have this */ +#if defined(MINGW32) || defined(__WATCOMC__) /* Borland and MS don't have this */ /* Define if you have the header file. */ #define HAVE_UNISTD_H 1 diff --git a/lib/connect.c b/lib/connect.c index 2330e6418..69d0dd308 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -66,11 +66,11 @@ #ifdef WIN32 #define HAVE_IOCTLSOCKET #include -#include #define EINPROGRESS WSAEINPROGRESS #define EWOULDBLOCK WSAEWOULDBLOCK #define EISCONN WSAEISCONN #define ENOTSOCK WSAENOTSOCK +#define ECONNREFUSED WSAECONNREFUSED #endif #include "urldata.h" diff --git a/lib/dict.c b/lib/dict.c index 540d872c0..1c85a1081 100644 --- a/lib/dict.c +++ b/lib/dict.c @@ -35,7 +35,6 @@ #include #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) -#include #include #include #else diff --git a/lib/easy.c b/lib/easy.c index 9ad2be40c..f76df632b 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -37,7 +37,6 @@ #include "strequal.h" #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) -#include #include #include #else diff --git a/lib/file.c b/lib/file.c index 4e08c03bc..1baa46d51 100644 --- a/lib/file.c +++ b/lib/file.c @@ -36,7 +36,6 @@ #include #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) -#include #include #include #include diff --git a/lib/ftp.c b/lib/ftp.c index 0da33fbbc..41ef3089f 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -39,7 +39,7 @@ #endif #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) -#include + #else /* some kind of unix */ #ifdef HAVE_SYS_SOCKET_H #include diff --git a/lib/hostip.c b/lib/hostip.c index e5363fa80..93a732d90 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -29,7 +29,7 @@ #define _REENTRANT #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) -#include +#include #else #ifdef HAVE_SYS_TYPES_H #include diff --git a/lib/http.c b/lib/http.c index ff6e432aa..041d6f944 100644 --- a/lib/http.c +++ b/lib/http.c @@ -36,7 +36,6 @@ #include #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) -#include #include #include #else diff --git a/lib/inet_pton.c b/lib/inet_pton.c index 82eba95bb..601042e1d 100644 --- a/lib/inet_pton.c +++ b/lib/inet_pton.c @@ -20,11 +20,6 @@ #ifndef HAVE_INET_PTON -#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) -#define EAFNOSUPPORT WSAEAFNOSUPPORT -#include -#else - #ifdef HAVE_SYS_PARAM_H #include #endif @@ -40,7 +35,6 @@ #ifdef HAVE_ARPA_INET_H #include #endif -#endif #include #include @@ -52,6 +46,10 @@ #define AF_INET6 AF_MAX+1 /* just to let this compile */ #endif +#ifdef WIN32 +#define EAFNOSUPPORT WSAEAFNOSUPPORT +#endif + /* * WARNING: Don't even consider trying to compile this on a system where * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. diff --git a/lib/memdebug.c b/lib/memdebug.c index 088c5cc50..83cc5d307 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -26,13 +26,9 @@ #include -#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) -#include -#else /* some kind of unix */ #ifdef HAVE_SYS_SOCKET_H #include #endif -#endif #define _MPRINTF_REPLACE #include diff --git a/lib/memdebug.h b/lib/memdebug.h index dae8ce151..b28154a81 100644 --- a/lib/memdebug.h +++ b/lib/memdebug.h @@ -28,9 +28,6 @@ #include #endif -#ifdef WIN32 -#include -#endif #ifdef HAVE_SYS_SOCKET_H #include #endif diff --git a/lib/progress.c b/lib/progress.c index 5036efaeb..cb64e0b06 100644 --- a/lib/progress.c +++ b/lib/progress.c @@ -24,13 +24,7 @@ #include "setup.h" #include - -#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) -#if defined(__MINGW32__) -#include -#endif #include -#endif /* 20000318 mgs * later we use _scrsize to determine the screen width, this emx library diff --git a/lib/sendf.c b/lib/sendf.c index b964bdd56..76e01393e 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -39,9 +39,6 @@ #ifdef HAVE_UNISTD_H #include #endif -#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) -#include -#endif #include #include "urldata.h" diff --git a/lib/setup.h b/lib/setup.h index 92decad04..60b9c9766 100644 --- a/lib/setup.h +++ b/lib/setup.h @@ -119,6 +119,17 @@ defined(HAVE_LIBSSL) && defined(HAVE_LIBCRYPTO) */ #ifdef WIN32 + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN /* Prevent including in */ +#endif + +#include /* required by telnet.c */ + +#if defined(ENABLE_IPV6) || defined(USE_SSLEAY) +#include +#endif + #if !defined(__GNUC__) || defined(__MINGW32__) #define sclose(x) closesocket(x) #define sread(x,y,z) recv(x,y,z,0) diff --git a/lib/speedcheck.c b/lib/speedcheck.c index f61443848..c7a6ae405 100644 --- a/lib/speedcheck.c +++ b/lib/speedcheck.c @@ -25,9 +25,6 @@ #include #include -#if defined(__MINGW32__) -#include -#endif #include #include "urldata.h" diff --git a/lib/telnet.c b/lib/telnet.c index 70683f48f..d01ae25bb 100644 --- a/lib/telnet.c +++ b/lib/telnet.c @@ -35,8 +35,7 @@ #include -#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) -#include +#if defined(WIN32) #include #include #else diff --git a/lib/timeval.c b/lib/timeval.c index 7ab711631..cb0ae1249 100644 --- a/lib/timeval.c +++ b/lib/timeval.c @@ -21,14 +21,13 @@ * $Id$ ***************************************************************************/ -#ifdef WIN32 -#include -#endif #include "timeval.h" #ifndef HAVE_GETTIMEOFDAY #ifdef WIN32 +#include + int gettimeofday (struct timeval *tp, void *nothing) { diff --git a/lib/timeval.h b/lib/timeval.h index 7be60657f..02d08fa60 100644 --- a/lib/timeval.h +++ b/lib/timeval.h @@ -27,7 +27,6 @@ #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) #include -#include #else #include #endif diff --git a/lib/transfer.c b/lib/transfer.c index 2412f12b2..c7e9bac44 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -37,7 +37,6 @@ #include "strequal.h" #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) -#include #include #include #else diff --git a/lib/url.c b/lib/url.c index 435e6b3d1..c76ad9e7f 100644 --- a/lib/url.c +++ b/lib/url.c @@ -36,7 +36,6 @@ #include #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) -#include #include #include #else