diff options
author | David Robillard <d@drobilla.net> | 2021-01-02 21:32:51 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-01-02 21:40:08 +0100 |
commit | 09df1497605ec344543a712705ecdf01147e9e9e (patch) | |
tree | 6918d8a035ede9606bd18b0cba028275e08559f1 /include | |
parent | 4fea00687038ac08f7fa271826b82e4de2b95983 (diff) | |
download | pugl-09df1497605ec344543a712705ecdf01147e9e9e.tar.gz pugl-09df1497605ec344543a712705ecdf01147e9e9e.tar.bz2 pugl-09df1497605ec344543a712705ecdf01147e9e9e.zip |
Simplify visibility boilerplate
Diffstat (limited to 'include')
-rw-r--r-- | include/pugl/pugl.h | 19 |
1 files changed, 6 insertions, 13 deletions
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 <stddef.h> #include <stdint.h> -#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 |