GetPluginFactory() def-file vs. declspec

SDK for VST 3 audio plug-in and host development.
Post Reply
sgretscher
Posts: 18
Joined: Tue Jul 05, 2016 6:30 pm

GetPluginFactory() def-file vs. declspec

Post by sgretscher »

in plugininterfaces, ivstcomponent.h defines GetPluginFactory() with EXPORT_FACTORY
EXPORT_FACTORY IPluginFactory* PLUGIN_API GetPluginFactory ()
but ipluginbase.h declares this without it
Steinberg::IPluginFactory* PLUGIN_API GetPluginFactory ();

EXPORT_FACTORY however is defined much "later" in public.sdk in pluginfactory.h as
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
#define EXPORT_FACTORY __attribute__ ((visibility ("default")))
#else
#define EXPORT_FACTORY
#endif

This is a problem because in our implementation we would like to skip the Windows .def file by using
#if defined(_MSC_VER)
#define EXPORT_FACTORY __declspec(dllexport)
#else
//...

This is has been supported since at least VS2010 and would mirror the Mac implementation, but it fails to build with the current SDK due to the above inconsistency.
Would it be possible for the SDK to (preferably) adopt that __declspec(dllexport), or else to consistently use EXPORT_FACTORY in plugininterfaces so that we can just define it?

Thanks,
Stefan

PS: the latter requires additional #ifndef EXPORT_FACTORY define EXPORT_FACTORY #endif
PSS: we're not including/using pluginfactory.h

User avatar
ygrabit
Posts: 179
Joined: Fri Jun 17, 2016 7:52 am
Location: Hamburg
Contact:

Re: GetPluginFactory() def-file vs. declspec

Post by ygrabit »

Hi
yes we will see what we could do here, we will need to adapt our cmake too... keep you inform...
YVan Grabit

User avatar
ygrabit
Posts: 179
Joined: Fri Jun 17, 2016 7:52 am
Location: Hamburg
Contact:

Re: GetPluginFactory() def-file vs. declspec

Post by ygrabit »

In the next update we will remove .def file for Windows.
YVan Grabit

sgretscher
Posts: 18
Joined: Tue Jul 05, 2016 6:30 pm

Re: GetPluginFactory() def-file vs. declspec

Post by sgretscher »

Thanks Yvan! :-)
Stefan

Post Reply