From d82811303b67fdb962c190f48cf89bc38298f506 Mon Sep 17 00:00:00 2001 From: Don Date: Wed, 5 Sep 2018 10:01:50 -0700 Subject: [PATCH] Use __has_declspec_attribute for shared builds --- lib/includes/nghttp2/nghttp2.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/includes/nghttp2/nghttp2.h b/lib/includes/nghttp2/nghttp2.h index 8c54b9c8..deaba757 100644 --- a/lib/includes/nghttp2/nghttp2.h +++ b/lib/includes/nghttp2/nghttp2.h @@ -31,6 +31,11 @@ # define WIN32 #endif +/* Compatibility for non-Clang compilers */ +#ifndef __has_declspec_attribute +# define __has_declspec_attribute(x) 0 +#endif + #ifdef __cplusplus extern "C" { #endif @@ -51,7 +56,7 @@ extern "C" { #ifdef NGHTTP2_STATICLIB # define NGHTTP2_EXTERN -#elif defined(WIN32) +#elif defined(WIN32) || (__has_declspec_attribute(dllexport) && __has_declspec_attribute(dllimport)) # ifdef BUILDING_NGHTTP2 # define NGHTTP2_EXTERN __declspec(dllexport) # else /* !BUILDING_NGHTTP2 */