diff --git a/docs/libcurl/symbols-in-versions b/docs/libcurl/symbols-in-versions index 640344f0e6..0b566edbc3 100644 --- a/docs/libcurl/symbols-in-versions +++ b/docs/libcurl/symbols-in-versions @@ -45,6 +45,7 @@ CURL_GLOBAL_DEFAULT 7.8 CURL_GLOBAL_NOTHING 7.8 CURL_GLOBAL_SSL 7.8 CURL_GLOBAL_WIN32 7.8.1 +CURL_HAS_DECLSPEC_ATTRIBUTE 8.13.0 CURL_HET_DEFAULT 7.59.0 CURL_HTTP_VERSION_1_0 7.9.1 CURL_HTTP_VERSION_1_1 7.9.1 diff --git a/include/curl/curl.h b/include/curl/curl.h index 99c57f2169..346872b39d 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -102,11 +102,6 @@ #include #endif -/* Compatibility for non-Clang compilers */ -#ifndef __has_declspec_attribute -# define __has_declspec_attribute(x) 0 -#endif - #ifdef __cplusplus extern "C" { #endif @@ -118,11 +113,17 @@ typedef void CURLSH; * libcurl external API function linkage decorations. */ +#ifdef __has_declspec_attribute +#define CURL_HAS_DECLSPEC_ATTRIBUTE(x) __has_declspec_attribute(x) +#else +#define CURL_HAS_DECLSPEC_ATTRIBUTE(x) 0 +#endif + #ifdef CURL_STATICLIB # define CURL_EXTERN #elif defined(_WIN32) || \ - (__has_declspec_attribute(dllexport) && \ - __has_declspec_attribute(dllimport)) + (CURL_HAS_DECLSPEC_ATTRIBUTE(dllexport) && \ + CURL_HAS_DECLSPEC_ATTRIBUTE(dllimport)) # if defined(BUILDING_LIBCURL) # define CURL_EXTERN __declspec(dllexport) # else