diff --git a/lib/hostares.c b/lib/hostares.c index baaa4b0fb..6ea6e51d5 100644 --- a/lib/hostares.c +++ b/lib/hostares.c @@ -26,9 +26,9 @@ #include #include -#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) +#ifdef HAVE_MALLOC_H /* Win32 */ #include -#else +#endif #ifdef HAVE_SYS_TYPES_H #include #endif @@ -55,13 +55,12 @@ #include #include #endif -#endif #ifdef HAVE_SETJMP_H #include #endif -#ifdef WIN32 +#ifdef HAVE_PROCESS_H #include #endif diff --git a/lib/hostasyn.c b/lib/hostasyn.c index d1b7cdd18..f9e9edbef 100644 --- a/lib/hostasyn.c +++ b/lib/hostasyn.c @@ -26,9 +26,9 @@ #include #include -#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) +#ifdef HAVE_MALLOC_H /* Win32 */ #include -#else +#endif #ifdef HAVE_SYS_TYPES_H #include #endif @@ -55,13 +55,12 @@ #include #include #endif -#endif #ifdef HAVE_SETJMP_H #include #endif -#ifdef WIN32 +#ifdef HAVE_PROCESS_H #include #endif diff --git a/lib/hostip.c b/lib/hostip.c index 6cf652f87..407c6b2f8 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -26,9 +26,9 @@ #include #include -#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) +#ifdef HAVE_MALLOC_H /* Win32 */ #include -#else +#endif #ifdef HAVE_SYS_TYPES_H #include #endif @@ -55,13 +55,12 @@ #include #include #endif -#endif #ifdef HAVE_SETJMP_H #include #endif -#ifdef WIN32 +#ifdef HAVE_PROCESS_H #include #endif diff --git a/lib/hostip4.c b/lib/hostip4.c index c7bdb6dc9..4e57d3e80 100644 --- a/lib/hostip4.c +++ b/lib/hostip4.c @@ -26,9 +26,9 @@ #include #include -#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) +#ifdef HAVE_MALLOC_H /* Win32 */ #include -#else +#endif #ifdef HAVE_SYS_TYPES_H #include #endif @@ -55,13 +55,12 @@ #include #include #endif -#endif #ifdef HAVE_SETJMP_H #include #endif -#ifdef WIN32 +#ifdef HAVE_PROCESS_H #include #endif diff --git a/lib/hostip6.c b/lib/hostip6.c index ae36ad738..693b98e4c 100644 --- a/lib/hostip6.c +++ b/lib/hostip6.c @@ -26,9 +26,9 @@ #include #include -#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) +#ifdef HAVE_MALLOC_H #include -#else +#endif #ifdef HAVE_SYS_TYPES_H #include #endif @@ -55,13 +55,12 @@ #include #include #endif -#endif #ifdef HAVE_SETJMP_H #include #endif -#ifdef WIN32 +#ifdef HAVE_PROCESS_H #include #endif @@ -143,10 +142,10 @@ int curl_dogetnameinfo(const struct sockaddr *sa, socklen_t salen, char *serv, size_t servlen, int flags, int line, const char *source) { - int res = (getnameinfo)(sa, salen, - host, hostlen, - serv, servlen, - flags); + int res = (getnameinfo)(sa, salen, + host, hostlen, + serv, servlen, + flags); if(0 == res) { /* success */ if(logfile) diff --git a/lib/hostsyn.c b/lib/hostsyn.c index fac78f11f..30dc4963a 100644 --- a/lib/hostsyn.c +++ b/lib/hostsyn.c @@ -26,9 +26,9 @@ #include #include -#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) +#ifdef HAVE_MALLOC_H #include -#else +#endif #ifdef HAVE_SYS_TYPES_H #include #endif @@ -55,13 +55,12 @@ #include #include #endif -#endif #ifdef HAVE_SETJMP_H #include #endif -#ifdef WIN32 +#ifdef HAVE_PROCESS_H #include #endif diff --git a/lib/hostthre.c b/lib/hostthre.c index 32d212f14..504af41b6 100644 --- a/lib/hostthre.c +++ b/lib/hostthre.c @@ -26,9 +26,9 @@ #include #include -#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) +#ifdef HAVE_MALLOC_H #include -#else +#endif #ifdef HAVE_SYS_TYPES_H #include #endif @@ -55,14 +55,12 @@ #include #include #endif -#endif #ifdef HAVE_SETJMP_H #include #endif -#ifdef WIN32 -#include +#ifdef HAVE_PROCESS_H #include #endif @@ -301,7 +299,7 @@ static unsigned __stdcall gethostbyname_thread (void *arg) struct thread_sync_data tsd = { 0,0,0,NULL }; if (!init_thread_sync_data(td, conn->async.hostname, &tsd)) { /* thread synchronization data initialization failed */ - return -1; + return (unsigned)-1; } /* Sharing the same _iob[] element with our parent thread should @@ -570,7 +568,7 @@ static bool init_resolve_thread (struct connectdata *conn, thread_and_event[1] = td->event_thread_started; if (WaitForMultipleObjects(sizeof(thread_and_event) / sizeof(thread_and_event[0]), - thread_and_event, FALSE, + (const HANDLE*)thread_and_event, FALSE, INFINITE) == WAIT_FAILED) { /* The resolver thread has been created, * most probably it works now - ignoring this "minor" error diff --git a/lib/ldap.c b/lib/ldap.c index 47b5fdefd..558d6f40f 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -36,10 +36,12 @@ #ifdef HAVE_SYS_STAT_H #include #endif +#ifdef HAVE_MALLOC_H +#include +#endif #include #if defined(WIN32) -# include # include #endif