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 1adebe7886
Reported-by: crazydef on github
Assisted-by: Marcel Raad
Fixes #4854
Closes #4855
This commit is contained in:
parent
3370725192
commit
8bd863f97b
@ -105,6 +105,7 @@ CURLE_OPERATION_TIMEOUTED 7.1 7.17.0
|
|||||||
CURLE_OUT_OF_MEMORY 7.1
|
CURLE_OUT_OF_MEMORY 7.1
|
||||||
CURLE_PARTIAL_FILE 7.1
|
CURLE_PARTIAL_FILE 7.1
|
||||||
CURLE_PEER_FAILED_VERIFICATION 7.17.1
|
CURLE_PEER_FAILED_VERIFICATION 7.17.1
|
||||||
|
CURLE_QUIC_CONNECT_ERROR 7.69.0
|
||||||
CURLE_QUOTE_ERROR 7.17.0
|
CURLE_QUOTE_ERROR 7.17.0
|
||||||
CURLE_RANGE_ERROR 7.17.0
|
CURLE_RANGE_ERROR 7.17.0
|
||||||
CURLE_READ_ERROR 7.1
|
CURLE_READ_ERROR 7.1
|
||||||
@ -152,7 +153,6 @@ CURLE_URL_MALFORMAT_USER 7.1 7.17.0
|
|||||||
CURLE_USE_SSL_FAILED 7.17.0
|
CURLE_USE_SSL_FAILED 7.17.0
|
||||||
CURLE_WEIRD_SERVER_REPLY 7.51.0
|
CURLE_WEIRD_SERVER_REPLY 7.51.0
|
||||||
CURLE_WRITE_ERROR 7.1
|
CURLE_WRITE_ERROR 7.1
|
||||||
CURLE_QUIC_CONNECT_ERROR 7.69.0
|
|
||||||
CURLFILETYPE_DEVICE_BLOCK 7.21.0
|
CURLFILETYPE_DEVICE_BLOCK 7.21.0
|
||||||
CURLFILETYPE_DEVICE_CHAR 7.21.0
|
CURLFILETYPE_DEVICE_CHAR 7.21.0
|
||||||
CURLFILETYPE_DIRECTORY 7.21.0
|
CURLFILETYPE_DIRECTORY 7.21.0
|
||||||
@ -960,5 +960,6 @@ CURL_VERSION_UNIX_SOCKETS 7.40.0
|
|||||||
CURL_WAIT_POLLIN 7.28.0
|
CURL_WAIT_POLLIN 7.28.0
|
||||||
CURL_WAIT_POLLOUT 7.28.0
|
CURL_WAIT_POLLOUT 7.28.0
|
||||||
CURL_WAIT_POLLPRI 7.28.0
|
CURL_WAIT_POLLPRI 7.28.0
|
||||||
|
CURL_WIN32 7.69.0
|
||||||
CURL_WRITEFUNC_PAUSE 7.18.0
|
CURL_WRITEFUNC_PAUSE 7.18.0
|
||||||
CURL_ZERO_TERMINATED 7.56.0
|
CURL_ZERO_TERMINATED 7.56.0
|
||||||
|
|||||||
@ -37,6 +37,15 @@
|
|||||||
#include "curlver.h" /* libcurl version defines */
|
#include "curlver.h" /* libcurl version defines */
|
||||||
#include "system.h" /* determine things run-time */
|
#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 <stdio.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
@ -49,7 +58,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <time.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) || \
|
#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || \
|
||||||
defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H))
|
defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H))
|
||||||
/* The check above prevents the winsock2 inclusion if winsock.h already was
|
/* The check above prevents the winsock2 inclusion if winsock.h already was
|
||||||
@ -70,11 +79,11 @@
|
|||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(WIN32) && !defined(_WIN32_WCE)
|
#if !defined(CURL_WIN32) && !defined(_WIN32_WCE)
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__)
|
#if !defined(CURL_WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__)
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -105,7 +114,7 @@ typedef void CURLSH;
|
|||||||
|
|
||||||
#ifdef CURL_STATICLIB
|
#ifdef CURL_STATICLIB
|
||||||
# define CURL_EXTERN
|
# define CURL_EXTERN
|
||||||
#elif defined(WIN32) || defined(__SYMBIAN32__) || \
|
#elif defined(CURL_WIN32) || defined(__SYMBIAN32__) || \
|
||||||
(__has_declspec_attribute(dllexport) && \
|
(__has_declspec_attribute(dllexport) && \
|
||||||
__has_declspec_attribute(dllimport))
|
__has_declspec_attribute(dllimport))
|
||||||
# if defined(BUILDING_LIBCURL)
|
# if defined(BUILDING_LIBCURL)
|
||||||
@ -121,7 +130,7 @@ typedef void CURLSH;
|
|||||||
|
|
||||||
#ifndef curl_socket_typedef
|
#ifndef curl_socket_typedef
|
||||||
/* 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;
|
typedef SOCKET curl_socket_t;
|
||||||
#define CURL_SOCKET_BAD INVALID_SOCKET
|
#define CURL_SOCKET_BAD INVALID_SOCKET
|
||||||
#else
|
#else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user