diff options
-rw-r--r-- | include/ingen/Module.hpp | 8 | ||||
-rw-r--r-- | include/ingen/client/client.h | 31 | ||||
-rw-r--r-- | include/ingen/ingen.h | 21 | ||||
-rw-r--r-- | src/client/ingen_client.cpp | 2 | ||||
-rw-r--r-- | src/gui/ingen_gui.cpp | 2 | ||||
-rw-r--r-- | src/server/Buffer.hpp | 4 | ||||
-rw-r--r-- | src/server/BufferFactory.hpp | 4 | ||||
-rw-r--r-- | src/server/BufferRef.hpp | 6 | ||||
-rw-r--r-- | src/server/DuplexPort.hpp | 4 | ||||
-rw-r--r-- | src/server/Engine.hpp | 4 | ||||
-rw-r--r-- | src/server/GraphImpl.hpp | 3 | ||||
-rw-r--r-- | src/server/PortImpl.hpp | 4 | ||||
-rw-r--r-- | src/server/PostProcessor.hpp | 5 | ||||
-rw-r--r-- | src/server/ThreadManager.hpp | 4 | ||||
-rw-r--r-- | src/server/UndoStack.hpp | 4 | ||||
-rw-r--r-- | src/server/ingen_engine.cpp | 2 | ||||
-rw-r--r-- | src/server/ingen_jack.cpp | 2 | ||||
-rw-r--r-- | src/server/ingen_portaudio.cpp | 2 | ||||
-rw-r--r-- | src/server/server.h | 31 |
19 files changed, 102 insertions, 41 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#" diff --git a/src/client/ingen_client.cpp b/src/client/ingen_client.cpp index f4d6bbc7..63705ebc 100644 --- a/src/client/ingen_client.cpp +++ b/src/client/ingen_client.cpp @@ -31,7 +31,7 @@ struct ClientModule : public ingen::Module { extern "C" { -ingen::Module* +INGEN_MODULE_EXPORT ingen::Module* ingen_module_load() { return new ingen::client::ClientModule(); diff --git a/src/gui/ingen_gui.cpp b/src/gui/ingen_gui.cpp index 118a9000..329e098f 100644 --- a/src/gui/ingen_gui.cpp +++ b/src/gui/ingen_gui.cpp @@ -68,7 +68,7 @@ struct GUIModule : public Module { extern "C" { -ingen::Module* +INGEN_MODULE_EXPORT ingen::Module* ingen_module_load() { Glib::thread_init(); diff --git a/src/server/Buffer.hpp b/src/server/Buffer.hpp index 21364fd9..e1ff2cf9 100644 --- a/src/server/Buffer.hpp +++ b/src/server/Buffer.hpp @@ -20,10 +20,10 @@ #include "BufferFactory.hpp" #include "BufferRef.hpp" #include "PortType.hpp" +#include "server.h" #include "types.hpp" #include "ingen/URIs.hpp" -#include "ingen/ingen.h" #include "lv2/atom/atom.h" #include "lv2/urid/urid.h" @@ -40,7 +40,7 @@ namespace server { class RunContext; -class INGEN_API Buffer +class INGEN_SERVER_API Buffer { public: Buffer(BufferFactory& bufs, diff --git a/src/server/BufferFactory.hpp b/src/server/BufferFactory.hpp index 19a61bed..5909754b 100644 --- a/src/server/BufferFactory.hpp +++ b/src/server/BufferFactory.hpp @@ -18,8 +18,8 @@ #define INGEN_ENGINE_BUFFERFACTORY_HPP #include "ingen/URIs.hpp" -#include "ingen/ingen.h" #include "lv2/urid/urid.h" +#include "server.h" #include "BufferRef.hpp" #include "types.hpp" @@ -39,7 +39,7 @@ namespace server { class Buffer; class Engine; -class INGEN_API BufferFactory { +class INGEN_SERVER_API BufferFactory { public: BufferFactory(Engine& engine, URIs& uris); ~BufferFactory(); diff --git a/src/server/BufferRef.hpp b/src/server/BufferRef.hpp index 958fcb06..bb692001 100644 --- a/src/server/BufferRef.hpp +++ b/src/server/BufferRef.hpp @@ -17,7 +17,7 @@ #ifndef INGEN_ENGINE_BUFFER_REF_HPP #define INGEN_ENGINE_BUFFER_REF_HPP -#include "ingen/ingen.h" +#include "server.h" #include <boost/smart_ptr/intrusive_ptr.hpp> // IWYU pragma: export @@ -29,8 +29,8 @@ class Buffer; using BufferRef = boost::intrusive_ptr<Buffer>; // Defined in Buffer.cpp -INGEN_API void intrusive_ptr_add_ref(Buffer* b); -INGEN_API void intrusive_ptr_release(Buffer* b); +INGEN_SERVER_API void intrusive_ptr_add_ref(Buffer* b); +INGEN_SERVER_API void intrusive_ptr_release(Buffer* b); } // namespace server } // namespace ingen diff --git a/src/server/DuplexPort.hpp b/src/server/DuplexPort.hpp index cdd764a0..01af01fc 100644 --- a/src/server/DuplexPort.hpp +++ b/src/server/DuplexPort.hpp @@ -20,10 +20,10 @@ #include "InputPort.hpp" #include "PortImpl.hpp" #include "PortType.hpp" +#include "server.h" #include "types.hpp" #include "ingen/URI.hpp" -#include "ingen/ingen.h" #include "lv2/urid/urid.h" #include "raul/Maid.hpp" @@ -55,7 +55,7 @@ class RunContext; * * \ingroup engine */ -class INGEN_API DuplexPort final +class INGEN_SERVER_API DuplexPort final : public InputPort , public boost::intrusive::slist_base_hook<> // In GraphImpl { diff --git a/src/server/Engine.hpp b/src/server/Engine.hpp index b5b6a311..711e0bed 100644 --- a/src/server/Engine.hpp +++ b/src/server/Engine.hpp @@ -19,12 +19,12 @@ #include "Event.hpp" #include "Load.hpp" +#include "server.h" #include "types.hpp" #include "ingen/Clock.hpp" #include "ingen/EngineBase.hpp" #include "ingen/Properties.hpp" -#include "ingen/ingen.h" #include <chrono> #include <condition_variable> @@ -75,7 +75,7 @@ class Worker; @ingroup engine */ -class INGEN_API Engine final : public EngineBase +class INGEN_SERVER_API Engine final : public EngineBase { public: explicit Engine(ingen::World& world); diff --git a/src/server/GraphImpl.hpp b/src/server/GraphImpl.hpp index cbbd57de..8911efb6 100644 --- a/src/server/GraphImpl.hpp +++ b/src/server/GraphImpl.hpp @@ -20,6 +20,7 @@ #include "BlockImpl.hpp" #include "DuplexPort.hpp" #include "ThreadManager.hpp" +#include "server.h" #include "types.hpp" #include "ingen/Node.hpp" @@ -63,7 +64,7 @@ class RunContext; * * \ingroup engine */ -class GraphImpl final : public BlockImpl +class INGEN_SERVER_API GraphImpl final : public BlockImpl { public: GraphImpl(Engine& engine, diff --git a/src/server/PortImpl.hpp b/src/server/PortImpl.hpp index d79bb6cd..ee3a2bf8 100644 --- a/src/server/PortImpl.hpp +++ b/src/server/PortImpl.hpp @@ -22,12 +22,12 @@ #include "NodeImpl.hpp" #include "PortType.hpp" #include "RunContext.hpp" +#include "server.h" #include "types.hpp" #include "ingen/Atom.hpp" #include "ingen/Node.hpp" #include "ingen/URIs.hpp" -#include "ingen/ingen.h" #include "lv2/urid/urid.h" #include "raul/Array.hpp" #include "raul/Maid.hpp" @@ -57,7 +57,7 @@ class BlockImpl; * * \ingroup engine */ -class INGEN_API PortImpl : public NodeImpl +class INGEN_SERVER_API PortImpl : public NodeImpl { public: struct SetState { diff --git a/src/server/PostProcessor.hpp b/src/server/PostProcessor.hpp index ab8ba6bc..a29d60da 100644 --- a/src/server/PostProcessor.hpp +++ b/src/server/PostProcessor.hpp @@ -17,10 +17,9 @@ #ifndef INGEN_ENGINE_POSTPROCESSOR_HPP #define INGEN_ENGINE_POSTPROCESSOR_HPP +#include "server.h" #include "types.hpp" -#include "ingen/ingen.h" - #include <atomic> namespace ingen { @@ -41,7 +40,7 @@ class RunContext; * * \ingroup engine */ -class INGEN_API PostProcessor +class INGEN_SERVER_API PostProcessor { public: explicit PostProcessor(Engine& engine); diff --git a/src/server/ThreadManager.hpp b/src/server/ThreadManager.hpp index 81fb15cb..4db87c1c 100644 --- a/src/server/ThreadManager.hpp +++ b/src/server/ThreadManager.hpp @@ -17,7 +17,7 @@ #ifndef INGEN_ENGINE_THREADMANAGER_HPP #define INGEN_ENGINE_THREADMANAGER_HPP -#include "ingen/ingen.h" +#include "server.h" #include <cassert> @@ -31,7 +31,7 @@ enum ThreadFlag { THREAD_MESSAGE = 1 << 3, }; -class INGEN_API ThreadManager { +class INGEN_SERVER_API ThreadManager { public: static inline void set_flag(ThreadFlag f) { #ifndef NDEBUG diff --git a/src/server/UndoStack.hpp b/src/server/UndoStack.hpp index 7749b8fb..713ad777 100644 --- a/src/server/UndoStack.hpp +++ b/src/server/UndoStack.hpp @@ -18,10 +18,10 @@ #define INGEN_ENGINE_UNDOSTACK_HPP #include "ingen/AtomSink.hpp" -#include "ingen/ingen.h" #include "lv2/atom/atom.h" #include "lv2/atom/util.h" #include "serd/serd.h" +#include "server.h" #include "sratom/sratom.h" #include <algorithm> @@ -39,7 +39,7 @@ class URIs; namespace server { -class INGEN_API UndoStack : public AtomSink { +class INGEN_SERVER_API UndoStack : public AtomSink { public: struct Entry { Entry(time_t t=0) : time(t) {} diff --git a/src/server/ingen_engine.cpp b/src/server/ingen_engine.cpp index a5735f33..fd4a8ced 100644 --- a/src/server/ingen_engine.cpp +++ b/src/server/ingen_engine.cpp @@ -41,7 +41,7 @@ struct EngineModule : public Module { extern "C" { -ingen::Module* +INGEN_MODULE_EXPORT ingen::Module* ingen_module_load() { return new ingen::EngineModule(); diff --git a/src/server/ingen_jack.cpp b/src/server/ingen_jack.cpp index 97d72919..0d3263be 100644 --- a/src/server/ingen_jack.cpp +++ b/src/server/ingen_jack.cpp @@ -58,7 +58,7 @@ struct JackModule : public Module { extern "C" { -ingen::Module* +INGEN_MODULE_EXPORT ingen::Module* ingen_module_load() { return new ingen::server::JackModule(); diff --git a/src/server/ingen_portaudio.cpp b/src/server/ingen_portaudio.cpp index 991470e4..af67d848 100644 --- a/src/server/ingen_portaudio.cpp +++ b/src/server/ingen_portaudio.cpp @@ -51,7 +51,7 @@ struct PortAudioModule : public Module { extern "C" { -ingen::Module* +INGEN_MODULE_EXPORT ingen::Module* ingen_module_load() { return new ingen::server::PortAudioModule(); diff --git a/src/server/server.h b/src/server/server.h new file mode 100644 index 00000000..d4ca5155 --- /dev/null +++ b/src/server/server.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_SERVER_SERVER_H +#define INGEN_SERVER_SERVER_H + +#if defined(_WIN32) && !defined(INGEN_SERVER_STATIC) && \ + defined(INGEN_SERVER_INTERNAL) +# define INGEN_SERVER_API __declspec(dllexport) +#elif defined(_WIN32) && !defined(INGEN_SERVER_STATIC) +# define INGEN_SERVER_API __declspec(dllimport) +#elif defined(__GNUC__) +# define INGEN_SERVER_API __attribute__((visibility("default"))) +#else +# define INGEN_SERVER_API +#endif + +#endif // INGEN_SERVER_SERVER_H |