fix: Manually initialize library plugins
This commit is contained in:
parent
037d77f28e
commit
0b5656dcc4
2
lib/external/pattern_language
vendored
2
lib/external/pattern_language
vendored
@ -1 +1 @@
|
||||
Subproject commit 78cdc3e7fd67ec7c95a186ee97215ff29a0316ce
|
||||
Subproject commit 7fd9967ee74250876a272819c3a70e39200bc68d
|
@ -29,11 +29,6 @@
|
||||
#define IMHEX_LIBRARY_SETUP_IMPL(name) \
|
||||
namespace { static struct EXIT_HANDLER { ~EXIT_HANDLER() { hex::log::info("Unloaded library '{}'", name); } } HANDLER; } \
|
||||
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) { \
|
||||
ImGui::SetCurrentContext(ctx); \
|
||||
GImGui = ctx; \
|
||||
|
@ -92,10 +92,10 @@ namespace hex {
|
||||
const auto pluginName = wolv::util::toUTF8String(m_path.filename());
|
||||
|
||||
if (this->isLibraryPlugin()) {
|
||||
m_initialized = true;
|
||||
return true;
|
||||
m_functions.initializeLibraryFunction();
|
||||
}
|
||||
|
||||
|
||||
const auto requestedVersion = getCompatibleVersion();
|
||||
if (requestedVersion != ImHexApi::System::getImHexVersion()) {
|
||||
if (requestedVersion.empty()) {
|
||||
|
@ -390,10 +390,10 @@ namespace hex {
|
||||
|
||||
return "";
|
||||
#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());
|
||||
|
||||
return name;
|
||||
return name.data();
|
||||
#elif defined(OS_WEB)
|
||||
return "";
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user