What's the use of this:
#define PLUGIN_API
Of this particular line, none really. Basically to allow compilation of other parts of code, of functions declarations, where this macro is used. Without defining it to empty, other parts of code could error when compiling.
like this:
Steinberg::tresult PLUGIN_API initialize (Steinberg::FUnknown* context) SMTG_OVERRIDE;
Steinberg::tresult PLUGIN_API terminate () SMTG_OVERRIDE;
Sure, so PLUGIN_API
expands to nothing and is useless. However, someone might later compile the code for windows into a dll. To make a symbol visible in dll, one would have to go through all function declarations and add the proper specifier to them:
Steinberg::tresult __declspec(dllexport) initialize (Steinberg::FUnknown* context) SMTG_OVERRIDE;
Steinberg::tresult __declspec(dllexport) terminate () SMTG_OVERRIDE;
Or with the define just do:
#if I_AM_COMPILING_ON_WINDOWS_FOR_A_DLL
#define PLUGIN_API __declspec(dllexport)
#else
#define PLUGIN_API /* nothing needed */
// defining PLUGIN_API to be empty, allows code to compile with no additional work
#endif