From 08b89f80784e2885b45cdae0cd5e0a672b0611fd Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 2 Jan 2021 13:24:48 +0100 Subject: Use SORD_STATIC instead of SORD_SHARED to control visibility For consistency, this seems to be the most common convention. --- include/sord/sord.h | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/sord/sord.h b/include/sord/sord.h index 134d493..3179dd0 100644 --- a/include/sord/sord.h +++ b/include/sord/sord.h @@ -27,19 +27,12 @@ #include #include -#ifdef SORD_SHARED -# ifdef _WIN32 -# define SORD_LIB_IMPORT __declspec(dllimport) -# define SORD_LIB_EXPORT __declspec(dllexport) -# else -# define SORD_LIB_IMPORT __attribute__((visibility("default"))) -# define SORD_LIB_EXPORT __attribute__((visibility("default"))) -# endif -# ifdef SORD_INTERNAL -# define SORD_API SORD_LIB_EXPORT -# else -# define SORD_API SORD_LIB_IMPORT -# endif +#if defined(_WIN32) && !defined(SORD_STATIC) && defined(SORD_INTERNAL) +# define SORD_API __declspec(dllexport) +#elif defined(_WIN32) && !defined(SORD_STATIC) +# define SORD_API __declspec(dllimport) +#elif defined(__GNUC__) +# define SORD_API __attribute__((visibility("default"))) #else # define SORD_API #endif -- cgit v1.2.1