mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 21:47:40 -05:00
build/plugin: Make plugins no longer depend on their file name
This commit is contained in:
@@ -8,13 +8,10 @@
|
||||
|
||||
#define IMHEX_PLUGIN_SETUP(name, author, description) IMHEX_PLUGIN_SETUP_IMPL(IMHEX_PLUGIN_NAME, name, author, description)
|
||||
|
||||
#define IMHEX_PLUGIN_SETUP_IMPL(namespaceName, name, author, description) \
|
||||
namespace hex::plugin::namespaceName::internal { \
|
||||
[[gnu::visibility("default")]] void initializePlugin(); \
|
||||
\
|
||||
[[gnu::visibility("default")]] const char* getPluginName() { return name; } \
|
||||
[[gnu::visibility("default")]] const char* getPluginAuthor() { return author; } \
|
||||
[[gnu::visibility("default")]] const char* getPluginDescription() { return description; } \
|
||||
[[gnu::visibility("default")]] void setImGuiContext(ImGuiContext *ctx) { ImGui::SetCurrentContext(ctx); GImGui = ctx; } \
|
||||
} \
|
||||
void hex::plugin::namespaceName::internal::initializePlugin()
|
||||
#define IMHEX_PLUGIN_SETUP_IMPL(namespaceName, name, author, description) \
|
||||
extern "C" [[gnu::visibility("default")]] const char* getPluginName() { return name; } \
|
||||
extern "C" [[gnu::visibility("default")]] const char* getPluginAuthor() { return author; } \
|
||||
extern "C" [[gnu::visibility("default")]] const char* getPluginDescription() { return description; } \
|
||||
extern "C" [[gnu::visibility("default")]] const char* getCompatibleVersion() { return IMHEX_VERSION; } \
|
||||
extern "C" [[gnu::visibility("default")]] void setImGuiContext(ImGuiContext *ctx) { ImGui::SetCurrentContext(ctx); GImGui = ctx; } \
|
||||
extern "C" [[gnu::visibility("default")]] void initializePlugin()
|
||||
|
||||
Reference in New Issue
Block a user