aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon J Olmstead <don.j.olmstead@gmail.com>2019-02-25 14:17:51 -0800
committerDaniel Stenberg <daniel@haxx.se>2019-02-27 08:35:43 +0100
commit50482b8c0a2cf5315e66d182998c8fc4901ffb2d (patch)
tree96e38f71fcc3032a2b8f4bcd6cd0bca087a1b830
parent6cc6a447e62f80e88faf64b40ba2ff3b238be0f6 (diff)
curl.h: use __has_declspec_attribute for shared builds
Closes #3616
-rw-r--r--include/curl/curl.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/curl/curl.h b/include/curl/curl.h
index 88e1f39e8..f501fe631 100644
--- a/include/curl/curl.h
+++ b/include/curl/curl.h
@@ -91,6 +91,11 @@
#include <support/SupportDefs.h>
#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