diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-01-27 11:37:33 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-01-27 13:02:28 +0100 |
commit | 8bd863f97b6c79f561bc063e634cecdf4badf776 (patch) | |
tree | b902983d726fd5e5172edd01bfe7acad63f67fea /include | |
parent | 33707251921031bb87e3ad60e61ce3b025a66793 (diff) | |
download | curl-8bd863f97b6c79f561bc063e634cecdf4badf776.tar.gz |
curl.h: define CURL_WIN32 on windows
... so that the subsequent logic below can use a single known define to know
when built on Windows (as we don't define WIN32 anymore).
Follow-up to 1adebe7886ddf20b
Reported-by: crazydef on github
Assisted-by: Marcel Raad
Fixes #4854
Closes #4855
Diffstat (limited to 'include')
-rw-r--r-- | include/curl/curl.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/include/curl/curl.h b/include/curl/curl.h index bca7446d2..b7cb30a58 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -37,6 +37,15 @@ #include "curlver.h" /* libcurl version defines */ #include "system.h" /* determine things run-time */ +/* + * Define CURL_WIN32 when build target is Win32 API + */ + +#if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && \ + !defined(__SYMBIAN32__) +#define CURL_WIN32 +#endif + #include <stdio.h> #include <limits.h> @@ -49,7 +58,7 @@ #include <sys/types.h> #include <time.h> -#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__) +#if defined(CURL_WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__) #if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || \ defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H)) /* The check above prevents the winsock2 inclusion if winsock.h already was @@ -70,11 +79,11 @@ #include <sys/select.h> #endif -#if !defined(WIN32) && !defined(_WIN32_WCE) +#if !defined(CURL_WIN32) && !defined(_WIN32_WCE) #include <sys/socket.h> #endif -#if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__) +#if !defined(CURL_WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__) #include <sys/time.h> #endif @@ -105,7 +114,7 @@ typedef void CURLSH; #ifdef CURL_STATICLIB # define CURL_EXTERN -#elif defined(WIN32) || defined(__SYMBIAN32__) || \ +#elif defined(CURL_WIN32) || defined(__SYMBIAN32__) || \ (__has_declspec_attribute(dllexport) && \ __has_declspec_attribute(dllimport)) # if defined(BUILDING_LIBCURL) @@ -121,7 +130,7 @@ typedef void CURLSH; #ifndef curl_socket_typedef /* socket typedef */ -#if defined(WIN32) && !defined(__LWIP_OPT_H__) && !defined(LWIP_HDR_OPT_H) +#if defined(CURL_WIN32) && !defined(__LWIP_OPT_H__) && !defined(LWIP_HDR_OPT_H) typedef SOCKET curl_socket_t; #define CURL_SOCKET_BAD INVALID_SOCKET #else |