version 2.16.0, PIPluginLoader changes

This commit is contained in:
2021-02-15 16:02:24 +03:00
parent d94a98e1f9
commit f367ef00f7
3 changed files with 21 additions and 12 deletions

View File

@@ -67,15 +67,18 @@
# define PIP_PLUGIN_EXPORT
#endif
#define __PIP_PLUGIN_LOADER_VERSION_FUNC__ pip_loader_version
#define __PIP_PLUGIN_STATIC_MERGE_FUNC__ pip_merge_static
#define __PIP_PLUGIN_LOADER_VERSION__ 2
#define __PIP_PLUGIN_LOADER_VERSION_FUNC__ pip_loader_version
#define __PIP_PLUGIN_SET_USER_VERSION_FUNC__ pip_set_user_version
#define __PIP_PLUGIN_STATIC_MERGE_FUNC__ pip_merge_static
#define __PIP_PLUGIN_LOADER_VERSION__ 3
#define PIP_PLUGIN_SET_USER_VERSION(v) \
STATIC_INITIALIZER_BEGIN \
PIPluginInfo * pi = PIPluginInfoStorage::instance()->currentInfo(); \
if (pi) pi->setUserVersion(v); \
STATIC_INITIALIZER_END
extern "C" { \
PIP_PLUGIN_EXPORT void __PIP_PLUGIN_SET_USER_VERSION_FUNC__() { \
PIPluginInfo * pi = PIPluginInfoStorage::instance()->currentInfo(); \
if (pi) pi->setUserVersion(v); \
} \
}
#define PIP_PLUGIN_ADD_STATIC_SECTION(type, ptr) \
STATIC_INITIALIZER_BEGIN \
@@ -142,6 +145,7 @@ private:
class PIP_EXPORT PIPluginLoader {
public:
typedef int(*FunctionLoaderVersion)();
typedef void(*FunctionSetUserVersion)();
typedef void(*FunctionStaticMerge)(int, void *, void *);
//! Possible load plugin error
@@ -202,6 +206,7 @@ private:
PILibrary lib;
FunctionLoaderVersion func_loader_version;
FunctionSetUserVersion func_set_user_version;
FunctionStaticMerge func_static_merge;
PIString error_str;
Error error;