From: Don J Olmstead Date: Mon, 25 Feb 2019 22:17:51 +0000 (-0800) Subject: curl.h: use __has_declspec_attribute for shared builds X-Git-Tag: curl-7_64_1~81 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=50482b8c0a2cf5315e66d182998c8fc4901ffb2d;p=thirdparty%2Fcurl.git curl.h: use __has_declspec_attribute for shared builds Closes #3616 --- diff --git a/include/curl/curl.h b/include/curl/curl.h index 88e1f39e87..f501fe6310 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -91,6 +91,11 @@ #include #endif +/* Compatibility for non-Clang compilers */ +#ifndef __has_declspec_attribute +# define __has_declspec_attribute(x) 0 +#endif + #ifdef __cplusplus extern "C" { #endif @@ -109,7 +114,9 @@ typedef void CURLSH; #ifdef CURL_STATICLIB # define CURL_EXTERN -#elif defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__) +#elif defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__) || \ + (__has_declspec_attribute(dllexport) && \ + __has_declspec_attribute(dllimport)) # if defined(BUILDING_LIBCURL) # define CURL_EXTERN __declspec(dllexport) # else