LADSPA/CMT: fixed global initialization on Win32

Global initialization happens via a global startup/shutdown handler
instance. For some reason this does not work properly when building
a DLL file, therefore create this startup/shutdown handler instance
as a static variable in ladspa_descriptor().

Furthermore marked ladspa_descriptor as extern-C.
This commit is contained in:
Tobias Doerffel
2014-01-27 00:29:16 +01:00
parent 6217201184
commit bc4b83f443

View File

@@ -108,18 +108,26 @@ public:
finalise_modules();
}
} g_oStartupShutdownHandler;
} ;
/*****************************************************************************/
extern "C"
{
const LADSPA_Descriptor *
ladspa_descriptor(unsigned long Index) {
static StartupShutdownHandler handler;
if (Index < g_lPluginCount)
return g_ppsRegisteredDescriptors[Index];
else
return NULL;
}
};
/*****************************************************************************/
/* EOF */