From d6c5d24af3627ec12721e7d286d426ed12901b55 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sun, 18 Dec 2005 15:36:14 +0000 Subject: [PATCH] Cleanup windows header includes. Where aplicable, inclusion of windows.h winsock.h winsock2.h ws2tcpip.h is done in setup.h --- ares/ares.h | 5 +---- ares/nameser.h | 1 - include/curl/multi.h | 6 +----- lib/connect.c | 1 - lib/getenv.c | 5 ----- lib/ldap.c | 1 - lib/timeval.c | 1 - src/homedir.c | 3 --- src/main.c | 8 ++------ tests/server/util.h | 2 -- 10 files changed, 4 insertions(+), 29 deletions(-) diff --git a/ares/ares.h b/ares/ares.h index 7f76112f7..695f8aafb 100644 --- a/ares/ares.h +++ b/ares/ares.h @@ -31,10 +31,7 @@ #include #include #include -#elif defined(WIN32) - #include - #include -#else +#elif !defined(WIN32) #include #include #endif diff --git a/ares/nameser.h b/ares/nameser.h index 7127c2640..0ccbfd1c0 100644 --- a/ares/nameser.h +++ b/ares/nameser.h @@ -7,7 +7,6 @@ port build */ #ifndef NETWARE -#include #include /* for the _getpid() proto */ #endif /* !NETWARE */ #include diff --git a/include/curl/multi.h b/include/curl/multi.h index 96c2763ef..35cf34885 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -45,11 +45,7 @@ #if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) || \ defined(__MINGW32__) -#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H)) -/* The check above prevents the winsock2 inclusion if winsock.h already was - included, since they can't co-exist without problems */ -#include -#endif + #else /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish diff --git a/lib/connect.c b/lib/connect.c index 42c0ea6e7..2fb08d628 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -83,7 +83,6 @@ #endif #ifdef WIN32 -#include #define EINPROGRESS WSAEINPROGRESS #define EWOULDBLOCK WSAEWOULDBLOCK #define EISCONN WSAEISCONN diff --git a/lib/getenv.c b/lib/getenv.c index fbf37a992..46b3375d9 100644 --- a/lib/getenv.c +++ b/lib/getenv.c @@ -27,10 +27,6 @@ #include #include -#ifdef WIN32 -#include -#endif - #ifdef VMS #include #endif @@ -47,7 +43,6 @@ char *GetEnv(const char *variable) return NULL; #else #ifdef WIN32 - /* This shit requires windows.h (HUGE) to be included */ char env[MAX_PATH]; /* MAX_PATH is from windef.h */ char *temp = getenv(variable); env[0] = '\0'; diff --git a/lib/ldap.c b/lib/ldap.c index 9c877e19f..d71b513f8 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -39,7 +39,6 @@ #include #if defined(WIN32) -# include # include # include #endif diff --git a/lib/timeval.c b/lib/timeval.c index ce866ca82..11f3d7a06 100644 --- a/lib/timeval.c +++ b/lib/timeval.c @@ -26,7 +26,6 @@ #ifndef HAVE_GETTIMEOFDAY #ifdef WIN32 -#include #include static int gettimeofday(struct timeval *tp, void *nothing) diff --git a/src/homedir.c b/src/homedir.c index e9b6db3be..f27aa6924 100644 --- a/src/homedir.c +++ b/src/homedir.c @@ -27,9 +27,6 @@ #include #include -#ifdef WIN32 -#include -#endif #ifdef HAVE_PWD_H #include #endif diff --git a/src/main.c b/src/main.c index a9a0c30fc..51e3413fb 100644 --- a/src/main.c +++ b/src/main.c @@ -47,10 +47,6 @@ #define CURLseparator "--_curl_--" -#if defined(WIN32)&&!defined(__CYGWIN32__) -#include -#endif - #ifdef __NOVELL_LIBC__ #include #endif @@ -2380,7 +2376,7 @@ static void parseconfig(const char *filename, } else { /* Get the filename of our executable. GetModuleFileName is - * defined in windows.h, which is #included into libcurl. + * already declared via inclusions done in setup header file. * We assume that we are using the ASCII version here. */ int n = GetModuleFileName(0, filebuffer, sizeof(filebuffer)); @@ -3114,7 +3110,7 @@ static void free_config_fields(struct Configurable *config) #if defined(WIN32) && !defined(__CYGWIN32__) /* Function to find CACert bundle on a Win32 platform using SearchPath. - * (SearchPath is defined in windows.h, which is #included into libcurl) + * (SearchPath is already declared via inclusions done in setup header file) * (Use the ASCII version instead of the unicode one!) * The order of the directories it searches is: * 1. application's directory diff --git a/tests/server/util.h b/tests/server/util.h index 357b49cc9..de33462cf 100644 --- a/tests/server/util.h +++ b/tests/server/util.h @@ -39,8 +39,6 @@ void logmsg(const char *msg, ...); extern const char *path; #if defined(WIN32) && !defined(__CYGWIN__) -#include -#include #include #define sleep(sec) Sleep ((sec)*1000)