From c2de0cce2ebb89dff347d33fd8c57942c297a6b6 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 15 Apr 2022 14:00:35 +0200 Subject: [PATCH] Use our own export macro --- src/common/utils.h | 2 ++ src/plugin/vst2-plugin.cpp | 8 +++----- src/plugin/vst3-plugin.cpp | 2 +- src/wine-host/group-host.cpp | 4 ++-- src/wine-host/individual-host.cpp | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/common/utils.h b/src/common/utils.h index 584d03a5..368721b2 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -21,6 +21,8 @@ #include #include +#define YABRIDGE_EXPORT __attribute__((visibility("default"))) + /** * The interval in seconds between synchronizing the Wine plugin host's audio * thread scheduling priority with the host's audio thread. diff --git a/src/plugin/vst2-plugin.cpp b/src/plugin/vst2-plugin.cpp index 9c314429..90b93e15 100644 --- a/src/plugin/vst2-plugin.cpp +++ b/src/plugin/vst2-plugin.cpp @@ -24,8 +24,6 @@ using namespace std::literals::string_literals; -#define VST_EXPORT __attribute__((visibility("default"))) - // The main entry point for VST2 plugins should be called `VSTPluginMain``. The // other one exist for legacy reasons since some old hosts might still use them // (EnergyXT being the only known host on Linux that uses the `main` entry @@ -40,7 +38,7 @@ using namespace std::literals::string_literals; * manual memory management. Clean up is done when we receive the `effClose` * opcode from the VST2 host (i.e. opcode 1).` */ -extern "C" VST_EXPORT AEffect* VSTPluginMain( +extern "C" YABRIDGE_EXPORT AEffect* VSTPluginMain( audioMasterCallback host_callback) { try { // This is the only place where we have to use manual memory management. @@ -73,8 +71,8 @@ extern "C" VST_EXPORT AEffect* VSTPluginMain( // XXX: GCC doens't seem to have a clean way to let you define an arbitrary // function called 'main'. Even JUCE does it this way, so it should be // safe. -extern "C" VST_EXPORT AEffect* deprecated_main( +extern "C" YABRIDGE_EXPORT AEffect* deprecated_main( audioMasterCallback audioMaster) asm("main"); -VST_EXPORT AEffect* deprecated_main(audioMasterCallback audioMaster) { +YABRIDGE_EXPORT AEffect* deprecated_main(audioMasterCallback audioMaster) { return VSTPluginMain(audioMaster); } diff --git a/src/plugin/vst3-plugin.cpp b/src/plugin/vst3-plugin.cpp index 44b23aa2..8d56906f 100644 --- a/src/plugin/vst3-plugin.cpp +++ b/src/plugin/vst3-plugin.cpp @@ -86,7 +86,7 @@ bool DeinitModule() { * the plugin in our Wine application, retrieve its information and supported * classes, and then recreate it here. */ -SMTG_EXPORT_SYMBOL Steinberg::IPluginFactory* PLUGIN_API GetPluginFactory() { +YABRIDGE_EXPORT Steinberg::IPluginFactory* PLUGIN_API GetPluginFactory() { // The host should have called `InitModule()` first assert(bridge); diff --git a/src/wine-host/group-host.cpp b/src/wine-host/group-host.cpp index eb11a763..daffae99 100644 --- a/src/wine-host/group-host.cpp +++ b/src/wine-host/group-host.cpp @@ -41,9 +41,9 @@ static const std::string host_name = "yabridge group host version " + * plugin host and this group plugin host will function identically on both the * plugin and the Wine VST host side. */ -int __attribute__((visibility("default"))) +int YABRIDGE_EXPORT #ifdef WINE_USE_CDECL -__cdecl + __cdecl #endif main(int argc, char* argv[]) { // Instead of directly hosting a plugin, this process will receive a UNIX diff --git a/src/wine-host/individual-host.cpp b/src/wine-host/individual-host.cpp index 2478e79d..bfaf319f 100644 --- a/src/wine-host/individual-host.cpp +++ b/src/wine-host/individual-host.cpp @@ -39,9 +39,9 @@ static const std::string host_name = "yabridge host version " + * plugin plugin, and then connect back to the `libyabridge-{vst2,vst3}.so` * instance that spawned this over the socket. */ -int __attribute__((visibility("default"))) +int YABRIDGE_EXPORT #ifdef WINE_USE_CDECL -__cdecl + __cdecl #endif main(int argc, char* argv[]) { // We pass the plugin format, the name of the VST2 plugin .dll file or VST3