From 09df1497605ec344543a712705ecdf01147e9e9e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 2 Jan 2021 21:32:51 +0100 Subject: Simplify visibility boilerplate --- include/pugl/pugl.h | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'include/pugl') diff --git a/include/pugl/pugl.h b/include/pugl/pugl.h index bb21a29..7cb7bc2 100644 --- a/include/pugl/pugl.h +++ b/include/pugl/pugl.h @@ -21,19 +21,12 @@ #include #include -#ifdef PUGL_SHARED -# ifdef _WIN32 -# define PUGL_LIB_IMPORT __declspec(dllimport) -# define PUGL_LIB_EXPORT __declspec(dllexport) -# else -# define PUGL_LIB_IMPORT __attribute__((visibility("default"))) -# define PUGL_LIB_EXPORT __attribute__((visibility("default"))) -# endif -# ifdef PUGL_INTERNAL -# define PUGL_API PUGL_LIB_EXPORT -# else -# define PUGL_API PUGL_LIB_IMPORT -# endif +#if defined(_WIN32) && !defined(PUGL_STATIC) && defined(PUGL_INTERNAL) +# define PUGL_API __declspec(dllexport) +#elif defined(_WIN32) && !defined(PUGL_STATIC) +# define PUGL_API __declspec(dllimport) +#elif defined(__GNUC__) +# define PUGL_API __attribute__((visibility("default"))) #else # define PUGL_API #endif -- cgit v1.2.1