diff --git a/source/backend/utils/CachedPlugins.cpp b/source/backend/utils/CachedPlugins.cpp index d8aacbf0c..d322c822d 100644 --- a/source/backend/utils/CachedPlugins.cpp +++ b/source/backend/utils/CachedPlugins.cpp @@ -34,7 +34,7 @@ namespace CB = CarlaBackend; // ------------------------------------------------------------------------------------------------------------------- -static const char* const gNullCharPtr = ""; +static const char* const gCachedPluginsNullCharPtr = ""; static bool isCachedPluginType(const CB::PluginType ptype) { @@ -64,10 +64,10 @@ _CarlaCachedPluginInfo::_CarlaCachedPluginInfo() noexcept midiOuts(0), parameterIns(0), parameterOuts(0), - name(gNullCharPtr), - label(gNullCharPtr), - maker(gNullCharPtr), - copyright(gNullCharPtr) {} + name(gCachedPluginsNullCharPtr), + label(gCachedPluginsNullCharPtr), + maker(gCachedPluginsNullCharPtr), + copyright(gCachedPluginsNullCharPtr) {} // ------------------------------------------------------------------------------------------------------------------- @@ -566,7 +566,7 @@ static const CarlaCachedPluginInfo* get_cached_plugin_au(const juce::String plug info.name = sname; info.label = slabel; info.maker = smaker; - info.copyright = gNullCharPtr; + info.copyright = gCachedPluginsNullCharPtr; return &info; } @@ -601,8 +601,8 @@ static const CarlaCachedPluginInfo* get_cached_plugin_sfz(const water::File& fil info.name = name.buffer(); info.label = filename.buffer(); - info.maker = gNullCharPtr; - info.copyright = gNullCharPtr; + info.maker = gCachedPluginsNullCharPtr; + info.copyright = gCachedPluginsNullCharPtr; return &info; } @@ -694,6 +694,8 @@ const CarlaCachedPluginInfo* carla_get_cached_plugin_info(CB::PluginType ptype, // ------------------------------------------------------------------------------------------------------------------- -#include "../native-plugins/_data.cpp" +#ifndef CARLA_PLUGIN_EXPORT +# include "../native-plugins/_data.cpp" +#endif // ------------------------------------------------------------------------------------------------------------------- diff --git a/source/backend/utils/Information.cpp b/source/backend/utils/Information.cpp index 436e1ed81..86d922e5d 100644 --- a/source/backend/utils/Information.cpp +++ b/source/backend/utils/Information.cpp @@ -221,7 +221,7 @@ const char* const* carla_get_supported_features() // ------------------------------------------------------------------------------------------------------------------- -#ifndef CARLA_SKIP_HOST_COMMON +#ifndef CARLA_PLUGIN_EXPORT # include "../CarlaHostCommon.cpp" #endif diff --git a/source/backend/utils/PipeClient.cpp b/source/backend/utils/PipeClient.cpp index 5ab6a73c3..38bf41771 100644 --- a/source/backend/utils/PipeClient.cpp +++ b/source/backend/utils/PipeClient.cpp @@ -209,6 +209,8 @@ void carla_pipe_client_destroy(CarlaPipeClientHandle handle) // ------------------------------------------------------------------------------------------------------------------- -#include "CarlaPipeUtils.cpp" +#ifndef CARLA_PLUGIN_EXPORT +# include "CarlaPipeUtils.cpp" +#endif // ------------------------------------------------------------------------------------------------------------------- diff --git a/source/plugin/carla-host-plugin.cpp b/source/plugin/carla-host-plugin.cpp index 10d3756a0..520041636 100644 --- a/source/plugin/carla-host-plugin.cpp +++ b/source/plugin/carla-host-plugin.cpp @@ -15,7 +15,19 @@ * For a full copy of the GNU General Public License see the doc/GPL.txt file. */ -#include "water/files/File.h" +#include "CarlaHost.h" +#include "CarlaUtils.h" + +#define CARLA_PLUGIN_EXPORT + +// ------------------------------------------------------------------------------------------------------------------- +// Include utils code first + +#include "utils/CachedPlugins.cpp" +#include "utils/Information.cpp" +#include "utils/PipeClient.cpp" +#include "utils/System.cpp" +#include "utils/Windows.cpp" // ------------------------------------------------------------------------------------------------------------------- // Always return a valid string ptr @@ -31,7 +43,6 @@ static void checkStringPtr(const char*& charPtr) noexcept // ------------------------------------------------------------------------------------------------------------------- // Include all standalone code -#define CARLA_PLUGIN_EXPORT #include "CarlaStandalone.cpp" // -------------------------------------------------------------------------------------------------------------------