summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-07-19 14:08:13 -0400
committerDavid Robillard <d@drobilla.net>2022-08-18 00:42:31 -0400
commit2b1513dc20d8c6a1d27c17d03d8bba98953ebfbc (patch)
tree52e42670217cf8ad7081c3913fc856a7c3b47269 /include
parent2f44d47ab3d06e106e034e1e66f5afc06ee75f89 (diff)
downloadingen-2b1513dc20d8c6a1d27c17d03d8bba98953ebfbc.tar.gz
ingen-2b1513dc20d8c6a1d27c17d03d8bba98953ebfbc.tar.bz2
ingen-2b1513dc20d8c6a1d27c17d03d8bba98953ebfbc.zip
Separate export macro definitions between modules
Diffstat (limited to 'include')
-rw-r--r--include/ingen/Module.hpp8
-rw-r--r--include/ingen/client/client.h31
-rw-r--r--include/ingen/ingen.h21
3 files changed, 45 insertions, 15 deletions
diff --git a/include/ingen/Module.hpp b/include/ingen/Module.hpp
index b540fe7d..149c25f9 100644
--- a/include/ingen/Module.hpp
+++ b/include/ingen/Module.hpp
@@ -55,8 +55,14 @@ public:
extern "C" {
+#ifdef _WIN32
+# define INGEN_MODULE_EXPORT __declspec(dllexport)
+#else
+# define INGEN_MODULE_EXPORT __attribute__((visibility("default")))
+#endif
+
/** Prototype for the ingen_module_load() entry point in an ingen module. */
-INGEN_API ingen::Module* ingen_module_load();
+INGEN_MODULE_EXPORT ingen::Module* ingen_module_load();
}
diff --git a/include/ingen/client/client.h b/include/ingen/client/client.h
new file mode 100644
index 00000000..6f7ac9b5
--- /dev/null
+++ b/include/ingen/client/client.h
@@ -0,0 +1,31 @@
+/*
+ This file is part of Ingen.
+ Copyright 2014-2022 David Robillard <http://drobilla.net/>
+
+ Ingen is free software: you can redistribute it and/or modify it under the
+ terms of the GNU Affero General Public License as published by the Free
+ Software Foundation, either version 3 of the License, or any later version.
+
+ Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU Affero General Public License for details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Ingen. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef INGEN_CLIENT_CLIENT_H
+#define INGEN_CLIENT_CLIENT_H
+
+#if defined(_WIN32) && !defined(INGEN_CLIENT_STATIC) && \
+ defined(INGEN_CLIENT_INTERNAL)
+# define INGEN_CLIENT_API __declspec(dllexport)
+#elif defined(_WIN32) && !defined(INGEN_CLIENT_STATIC)
+# define INGEN_CLIENT_API __declspec(dllimport)
+#elif defined(__GNUC__)
+# define INGEN_CLIENT_API __attribute__((visibility("default")))
+#else
+# define INGEN_CLIENT_API
+#endif
+
+#endif // INGEN_CLIENT_CLIENT_H
diff --git a/include/ingen/ingen.h b/include/ingen/ingen.h
index ccdb5596..9292de46 100644
--- a/include/ingen/ingen.h
+++ b/include/ingen/ingen.h
@@ -17,21 +17,14 @@
#ifndef INGEN_INGEN_H
#define INGEN_INGEN_H
-#ifdef INGEN_SHARED
-# ifdef _WIN32
-# define INGEN_LIB_IMPORT __declspec(dllimport)
-# define INGEN_LIB_EXPORT __declspec(dllexport)
-# else
-# define INGEN_LIB_IMPORT __attribute__((visibility("default")))
-# define INGEN_LIB_EXPORT __attribute__((visibility("default")))
-# endif
-# ifdef INGEN_INTERNAL
-# define INGEN_API INGEN_LIB_EXPORT
-# else
-# define INGEN_API INGEN_LIB_IMPORT
-# endif
+#if defined(_WIN32) && !defined(INGEN_STATIC) && defined(INGEN_INTERNAL)
+# define INGEN_API __declspec(dllexport)
+#elif defined(_WIN32) && !defined(INGEN_STATIC)
+# define INGEN_API __declspec(dllimport)
+#elif defined(__GNUC__)
+# define INGEN_API __attribute__((visibility("default")))
#else
-# define INGEN_API
+# define INGEN_API
#endif
#define INGEN_NS "http://drobilla.net/ns/ingen#"