summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-01-02 13:23:16 +0100
committerDavid Robillard <d@drobilla.net>2021-01-02 14:13:59 +0100
commit07c361def50e6a95e2f34a338c4d316efa0e3397 (patch)
treeeed60f3a78ab936a113ebdb3d502c4aa17679fdc /include
parentbbc9b1c424f80414eff33dd5ef513e4ef7844d93 (diff)
downloadsratom-07c361def50e6a95e2f34a338c4d316efa0e3397.tar.gz
sratom-07c361def50e6a95e2f34a338c4d316efa0e3397.tar.bz2
sratom-07c361def50e6a95e2f34a338c4d316efa0e3397.zip
Use SRATOM_STATIC instead of SRATOM_SHARED to control visibility
For consistency, this seems to be the most common convention.
Diffstat (limited to 'include')
-rw-r--r--include/sratom/sratom.h19
1 files changed, 6 insertions, 13 deletions
diff --git a/include/sratom/sratom.h b/include/sratom/sratom.h
index 9f06e9c..d0983e7 100644
--- a/include/sratom/sratom.h
+++ b/include/sratom/sratom.h
@@ -30,19 +30,12 @@
#include <stdbool.h>
#include <stdint.h>
-#ifdef SRATOM_SHARED
-# ifdef _WIN32
-# define SRATOM_LIB_IMPORT __declspec(dllimport)
-# define SRATOM_LIB_EXPORT __declspec(dllexport)
-# else
-# define SRATOM_LIB_IMPORT __attribute__((visibility("default")))
-# define SRATOM_LIB_EXPORT __attribute__((visibility("default")))
-# endif
-# ifdef SRATOM_INTERNAL
-# define SRATOM_API SRATOM_LIB_EXPORT
-# else
-# define SRATOM_API SRATOM_LIB_IMPORT
-# endif
+#if defined(_WIN32) && !defined(SRATOM_STATIC) && defined(SRATOM_INTERNAL)
+# define SRATOM_API __declspec(dllexport)
+#elif defined(_WIN32) && !defined(SRATOM_STATIC)
+# define SRATOM_API __declspec(dllimport)
+#elif defined(__GNUC__)
+# define SRATOM_API __attribute__((visibility("default")))
#else
# define SRATOM_API
#endif