From 64bbc31c5442569b30d27b345ef0dbd7e4a0ec09 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Thu, 13 May 2021 14:53:19 -0400 Subject: [PATCH] Remove macro making extern declaration of RegisterBuiltinModule... ... Forcing other places that use RegisterBuiltinModule to be more explicit about their link dependencies on ModuleManager, with a new #include directive. Does this make scripts/graph.pl show a new dependency cycle? Happily no. But now we know. --- include/audacity/ModuleInterface.h | 6 ------ src/ModuleManager.h | 8 ++++++++ src/commands/LoadCommands.cpp | 1 + src/effects/LoadEffects.cpp | 1 + src/effects/VST/VSTEffect.cpp | 1 + src/effects/audiounits/AudioUnitEffect.cpp | 1 + src/effects/ladspa/LadspaEffect.cpp | 1 + src/effects/lv2/LoadLV2.cpp | 1 + src/effects/nyquist/LoadNyquist.cpp | 1 + src/effects/vamp/LoadVamp.cpp | 1 + 10 files changed, 16 insertions(+), 6 deletions(-) diff --git a/include/audacity/ModuleInterface.h b/include/audacity/ModuleInterface.h index 9993153c7..480024a66 100644 --- a/include/audacity/ModuleInterface.h +++ b/include/audacity/ModuleInterface.h @@ -141,11 +141,6 @@ public: // ---------------------------------------------------------------------------- #define MODULE_ENTRY AudacityModule -// ---------------------------------------------------------------------------- -// The module entry point prototype -// ---------------------------------------------------------------------------- -typedef ModuleInterface *(*ModuleMain)(const wxString *path); - // ---------------------------------------------------------------------------- // If BUILDING_AUDACITY is defined during the current build, it is assumed // that the module wishes to be embedded in the Audacity executable. @@ -170,7 +165,6 @@ static ModuleInterface * name(const wxString *path) // method must be supplied explicitly. // ---------------------------------------------------------------------------- #define DECLARE_BUILTIN_MODULE_BASE(name) \ -extern void RegisterBuiltinModule(ModuleMain rtn); \ class name \ { \ public: \ diff --git a/src/ModuleManager.h b/src/ModuleManager.h index 178209778..1a2960191 100644 --- a/src/ModuleManager.h +++ b/src/ModuleManager.h @@ -130,4 +130,12 @@ private: std::vector> mModules; }; +// ---------------------------------------------------------------------------- +// The module entry point prototype +// ---------------------------------------------------------------------------- +using ModuleMain = ModuleInterface *(*)(const wxString *path); + +AUDACITY_DLL_API +void RegisterBuiltinModule(ModuleMain rtn); + #endif /* __AUDACITY_MODULEMANAGER_H__ */ diff --git a/src/commands/LoadCommands.cpp b/src/commands/LoadCommands.cpp index d7f787eee..7e989a5a0 100644 --- a/src/commands/LoadCommands.cpp +++ b/src/commands/LoadCommands.cpp @@ -16,6 +16,7 @@ modelled on BuiltinEffectsModule #include "LoadCommands.h" #include "AudacityCommand.h" +#include "ModuleManager.h" #include "../Prefs.h" diff --git a/src/effects/LoadEffects.cpp b/src/effects/LoadEffects.cpp index dbbee5d36..ce3b254f9 100644 --- a/src/effects/LoadEffects.cpp +++ b/src/effects/LoadEffects.cpp @@ -17,6 +17,7 @@ #include "../Prefs.h" #include "Effect.h" +#include "ModuleManager.h" static bool sInitialized = false; diff --git a/src/effects/VST/VSTEffect.cpp b/src/effects/VST/VSTEffect.cpp index e542c4f13..aef44543f 100644 --- a/src/effects/VST/VSTEffect.cpp +++ b/src/effects/VST/VSTEffect.cpp @@ -26,6 +26,7 @@ #include "VSTEffect.h" +#include "../../ModuleManager.h" #include "../../widgets/ProgressDialog.h" diff --git a/src/effects/audiounits/AudioUnitEffect.cpp b/src/effects/audiounits/AudioUnitEffect.cpp index 6773bf2b3..3b627eff8 100644 --- a/src/effects/audiounits/AudioUnitEffect.cpp +++ b/src/effects/audiounits/AudioUnitEffect.cpp @@ -18,6 +18,7 @@ #if USE_AUDIO_UNITS #include "AudioUnitEffect.h" +#include "../../ModuleManager.h" #include #include diff --git a/src/effects/ladspa/LadspaEffect.cpp b/src/effects/ladspa/LadspaEffect.cpp index 3119b6c90..26f8ed588 100644 --- a/src/effects/ladspa/LadspaEffect.cpp +++ b/src/effects/ladspa/LadspaEffect.cpp @@ -58,6 +58,7 @@ effects from this one class. #include "../../widgets/NumericTextCtrl.h" #include "../../widgets/valnum.h" #include "../../widgets/wxPanelWrapper.h" +#include "../../ModuleManager.h" #if wxUSE_ACCESSIBILITY #include "../../widgets/WindowAccessible.h" diff --git a/src/effects/lv2/LoadLV2.cpp b/src/effects/lv2/LoadLV2.cpp index 8168c4eb0..56b3c34eb 100755 --- a/src/effects/lv2/LoadLV2.cpp +++ b/src/effects/lv2/LoadLV2.cpp @@ -23,6 +23,7 @@ Functions that find and load all LV2 plugins on the system. #endif #include "LoadLV2.h" +#include "../../ModuleManager.h" #include #include diff --git a/src/effects/nyquist/LoadNyquist.cpp b/src/effects/nyquist/LoadNyquist.cpp index ef11b5375..e3a523830 100644 --- a/src/effects/nyquist/LoadNyquist.cpp +++ b/src/effects/nyquist/LoadNyquist.cpp @@ -18,6 +18,7 @@ #include "../../FileNames.h" #include "../../PluginManager.h" +#include "../../ModuleManager.h" // ============================================================================ // List of effects that ship with Audacity. These will be autoregistered. diff --git a/src/effects/vamp/LoadVamp.cpp b/src/effects/vamp/LoadVamp.cpp index 1ae11b550..c52ea50bb 100644 --- a/src/effects/vamp/LoadVamp.cpp +++ b/src/effects/vamp/LoadVamp.cpp @@ -12,6 +12,7 @@ #if defined(USE_VAMP) #include "LoadVamp.h" +#include "../../ModuleManager.h" #include