mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 09:20:16 +01:00
A macro for boilerplate to generate required module entry points
This commit is contained in:
@@ -31,4 +31,26 @@ enum ModuleDispatchTypes
|
||||
ProjectClosing
|
||||
};
|
||||
|
||||
// Macro generates one of the required entry points of a module
|
||||
// GetVersionString
|
||||
// REQUIRED for the module to be accepted by Audacity.
|
||||
// Without it Audacity will see a version number mismatch.
|
||||
#define DEFINE_VERSION_CHECK \
|
||||
extern "C" { \
|
||||
DLL_API const wchar_t * GetVersionString() \
|
||||
{ \
|
||||
/* Make sure that this version of the module requires the version \
|
||||
of Audacity it is built with. \
|
||||
For now, the versions must match exactly for Audacity to \
|
||||
agree to load the module. */ \
|
||||
return AUDACITY_VERSION_STRING; \
|
||||
} \
|
||||
}
|
||||
|
||||
// Macro generates minimal required entry points to load a module
|
||||
// Use it when you don't care about event notifications from the application
|
||||
#define DEFINE_MODULE_ENTRIES \
|
||||
DEFINE_VERSION_CHECK \
|
||||
extern "C" DLL_API int ModuleDispatch(ModuleDispatchTypes type){ return 1; }
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user