5#if defined _MSC_VER || defined __MINGW32__ || defined __MINGW64__
6 #define IMT_PLUGIN_FUNCTION_EXPORT __declspec(dllexport)
8 #define IMT_PLUGIN_FUNCTION_EXPORT __attribute__ ((visibility("default")))
10 #define IMT_PLUGIN_FUNCTION_EXPORT
13#define IMT_MAKE_STRING(value) #value
16 #define IMT_CREATE_PLUGIN_INSTANCE_FUNCTION(suffix) CreatePluginInstanceDebug##suffix
17 #define IMT_CREATE_PLUGIN_INSTANCE_FUNCTION_NAME(suffix) IMT_MAKE_STRING(CreatePluginInstanceDebug##suffix)
18#define IMT_DESTROY_PLUGIN_INSTANCE_FUNCTION(suffix) DestroyPluginInstanceDebug##suffix
19 #define IMT_DESTROY_PLUGIN_INSTANCE_FUNCTION_NAME(suffix) IMT_MAKE_STRING(DestroyPluginInstanceDebug##suffix)
21 #define IMT_CREATE_PLUGIN_INSTANCE_FUNCTION(suffix) CreatePluginInstance##suffix
22 #define IMT_CREATE_PLUGIN_INSTANCE_FUNCTION_NAME(suffix) IMT_MAKE_STRING(CreatePluginInstance##suffix)
23 #define IMT_DESTROY_PLUGIN_INSTANCE_FUNCTION(suffix) DestroyPluginInstance##suffix
24 #define IMT_DESTROY_PLUGIN_INSTANCE_FUNCTION_NAME(suffix) IMT_MAKE_STRING(DestroyPluginInstance##suffix)
28#define IMT_CREATE_PLUGIN_FUNCTION(PluginType) CreatePluginInstanceFunction##PluginType
29#define IMT_DESTROY_PLUGIN_FUNCTION(PluginType) DestroyPluginInstanceFunction##PluginType
31#define IMT_CREATE_PLUGIN_FUNCTION_PTR(PluginType, PluginInterface)\
32PluginInterface* (*IMT_CREATE_PLUGIN_FUNCTION(PluginType))();
34#define IMT_DESTROY_PLUGIN_FUNCTION_PTR(PluginType, PluginInterface)\
35void (*IMT_DESTROY_PLUGIN_FUNCTION(PluginType))(PluginInterface*);\
37#define IMT_DECLARE_PLUGIN_INTERFACE(PluginType, PluginInterface)\
38typedef IMT_CREATE_PLUGIN_FUNCTION_PTR(PluginType, PluginInterface);\
39typedef IMT_DESTROY_PLUGIN_FUNCTION_PTR(PluginType, PluginInterface);\
40extern "C" IMT_PLUGIN_FUNCTION_EXPORT PluginInterface* IMT_CREATE_PLUGIN_INSTANCE_FUNCTION(PluginType)();\
41extern "C" IMT_PLUGIN_FUNCTION_EXPORT void IMT_DESTROY_PLUGIN_INSTANCE_FUNCTION(PluginType)(PluginInterface* pluginInstancePtr);\
44#define IMT_REGISTER_PLUGIN(PluginInterface, PluginImplementation, PluginType, PluginName)\
45 IMT_DECLARE_PLUGIN_INTERFACE(PluginType, PluginInterface);\
46 PluginInterface* IMT_CREATE_PLUGIN_INSTANCE_FUNCTION(PluginType)()\
48 return new PluginImplementation(#PluginName, #PluginType);\
50 void IMT_DESTROY_PLUGIN_INSTANCE_FUNCTION(PluginType)(PluginInterface* pluginInstancePtr)\
52 Q_ASSERT(pluginInstancePtr != nullptr);\
53 if (pluginInstancePtr != nullptr){\
54 delete pluginInstancePtr;\