aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-11-10 15:35:07 +0100
committerDavid Robillard <d@drobilla.net>2020-11-10 18:29:45 +0100
commitf820212f2ac92400cf277686e4f79e740b95688c (patch)
tree94abb0d43c3f949b6b2ca2fbe39431c138a97ad5
parenta9efbbbbbd80322c134a62d9d986fc861346c5de (diff)
downloadserd-f820212f2ac92400cf277686e4f79e740b95688c.tar.gz
serd-f820212f2ac92400cf277686e4f79e740b95688c.tar.bz2
serd-f820212f2ac92400cf277686e4f79e740b95688c.zip
Simplify visibility boilerplate
-rw-r--r--include/serd/serd.h19
1 files changed, 6 insertions, 13 deletions
diff --git a/include/serd/serd.h b/include/serd/serd.h
index 514e0e1a..55813ba9 100644
--- a/include/serd/serd.h
+++ b/include/serd/serd.h
@@ -27,19 +27,12 @@
#include <stdint.h>
#include <stdio.h>
-#ifdef SERD_SHARED
-# ifdef _WIN32
-# define SERD_LIB_IMPORT __declspec(dllimport)
-# define SERD_LIB_EXPORT __declspec(dllexport)
-# else
-# define SERD_LIB_IMPORT __attribute__((visibility("default")))
-# define SERD_LIB_EXPORT __attribute__((visibility("default")))
-# endif
-# ifdef SERD_INTERNAL
-# define SERD_API SERD_LIB_EXPORT
-# else
-# define SERD_API SERD_LIB_IMPORT
-# endif
+#if defined(SERD_SHARED) && defined(SERD_INTERNAL) && defined(_WIN32)
+# define SERD_API __declspec(dllexport)
+#elif defined(SERD_SHARED) && defined(_WIN32)
+# define SERD_API __declspec(dllimport)
+#elif defined(SERD_SHARED) && defined(__GNUC__)
+# define SERD_API __attribute__((visibility("default")))
#else
# define SERD_API
#endif