From 2b1513dc20d8c6a1d27c17d03d8bba98953ebfbc Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 19 Jul 2022 14:08:13 -0400 Subject: Separate export macro definitions between modules --- src/client/ingen_client.cpp | 2 +- src/gui/ingen_gui.cpp | 2 +- src/server/Buffer.hpp | 4 ++-- src/server/BufferFactory.hpp | 4 ++-- src/server/BufferRef.hpp | 6 +++--- src/server/DuplexPort.hpp | 4 ++-- src/server/Engine.hpp | 4 ++-- src/server/GraphImpl.hpp | 3 ++- src/server/PortImpl.hpp | 4 ++-- src/server/PostProcessor.hpp | 5 ++--- src/server/ThreadManager.hpp | 4 ++-- src/server/UndoStack.hpp | 4 ++-- src/server/ingen_engine.cpp | 2 +- src/server/ingen_jack.cpp | 2 +- src/server/ingen_portaudio.cpp | 2 +- src/server/server.h | 31 +++++++++++++++++++++++++++++++ 16 files changed, 57 insertions(+), 26 deletions(-) create mode 100644 src/server/server.h (limited to 'src') 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 // IWYU pragma: export @@ -29,8 +29,8 @@ class Buffer; using BufferRef = boost::intrusive_ptr; // 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 #include @@ -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 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 @@ -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 @@ -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 + + 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 . +*/ + +#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 -- cgit v1.2.1