mirror of https://github.com/WerWolv/ImHex.git
fix: Manually initialize library plugins
This commit is contained in:
parent
037d77f28e
commit
0b5656dcc4
|
@ -1 +1 @@
|
||||||
Subproject commit 78cdc3e7fd67ec7c95a186ee97215ff29a0316ce
|
Subproject commit 7fd9967ee74250876a272819c3a70e39200bc68d
|
|
@ -29,11 +29,6 @@
|
||||||
#define IMHEX_LIBRARY_SETUP_IMPL(name) \
|
#define IMHEX_LIBRARY_SETUP_IMPL(name) \
|
||||||
namespace { static struct EXIT_HANDLER { ~EXIT_HANDLER() { hex::log::info("Unloaded library '{}'", name); } } HANDLER; } \
|
namespace { static struct EXIT_HANDLER { ~EXIT_HANDLER() { hex::log::info("Unloaded library '{}'", name); } } HANDLER; } \
|
||||||
IMHEX_PLUGIN_VISIBILITY_PREFIX void initializeLibrary(); \
|
IMHEX_PLUGIN_VISIBILITY_PREFIX void initializeLibrary(); \
|
||||||
static auto WOLV_TOKEN_CONCAT(libraryInitializer_, IMHEX_PLUGIN_NAME) = [] { \
|
|
||||||
initializeLibrary(); \
|
|
||||||
hex::log::info("Library plugin '{}' initialized successfully", WOLV_STRINGIFY(IMHEX_PLUGIN_NAME)); \
|
|
||||||
return 0; \
|
|
||||||
}(); \
|
|
||||||
IMHEX_PLUGIN_VISIBILITY_PREFIX void setImGuiContext(ImGuiContext *ctx) { \
|
IMHEX_PLUGIN_VISIBILITY_PREFIX void setImGuiContext(ImGuiContext *ctx) { \
|
||||||
ImGui::SetCurrentContext(ctx); \
|
ImGui::SetCurrentContext(ctx); \
|
||||||
GImGui = ctx; \
|
GImGui = ctx; \
|
||||||
|
|
|
@ -92,10 +92,10 @@ namespace hex {
|
||||||
const auto pluginName = wolv::util::toUTF8String(m_path.filename());
|
const auto pluginName = wolv::util::toUTF8String(m_path.filename());
|
||||||
|
|
||||||
if (this->isLibraryPlugin()) {
|
if (this->isLibraryPlugin()) {
|
||||||
m_initialized = true;
|
m_functions.initializeLibraryFunction();
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const auto requestedVersion = getCompatibleVersion();
|
const auto requestedVersion = getCompatibleVersion();
|
||||||
if (requestedVersion != ImHexApi::System::getImHexVersion()) {
|
if (requestedVersion != ImHexApi::System::getImHexVersion()) {
|
||||||
if (requestedVersion.empty()) {
|
if (requestedVersion.empty()) {
|
||||||
|
|
|
@ -390,10 +390,10 @@ namespace hex {
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
#elif defined(OS_MACOS) || defined(OS_LINUX)
|
#elif defined(OS_MACOS) || defined(OS_LINUX)
|
||||||
std::array<char, 256> name;
|
std::array<char, 256> name = { };
|
||||||
pthread_getname_np(pthread_self(), name.data(), name.size());
|
pthread_getname_np(pthread_self(), name.data(), name.size());
|
||||||
|
|
||||||
return name;
|
return name.data();
|
||||||
#elif defined(OS_WEB)
|
#elif defined(OS_WEB)
|
||||||
return "";
|
return "";
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue