sys: Moved more functions to libwolv

This commit is contained in:
WerWolv
2023-03-12 18:43:05 +01:00
parent 0dafb3d230
commit fb2e668589
22 changed files with 56 additions and 97 deletions

View File

@@ -3,6 +3,8 @@
#include <hex/helpers/logger.hpp>
#include <hex/helpers/utils.hpp>
#include <wolv/utils/string.hpp>
#include <filesystem>
#include <system_error>
@@ -17,7 +19,7 @@ namespace hex {
return;
}
#else
this->m_handle = dlopen(hex::toUTF8String(path).c_str(), RTLD_LAZY);
this->m_handle = dlopen(wolv::util::toUTF8String(path).c_str(), RTLD_LAZY);
if (this->m_handle == nullptr) {
log::error("dlopen failed: {}!", dlerror());
@@ -69,7 +71,7 @@ namespace hex {
bool Plugin::initializePlugin() const {
const auto requestedVersion = getCompatibleVersion();
if (requestedVersion != IMHEX_VERSION) {
log::error("Refused to load plugin '{}' which was built for a different version of ImHex: '{}'", hex::toUTF8String(this->m_path.filename()), requestedVersion);
log::error("Refused to load plugin '{}' which was built for a different version of ImHex: '{}'", wolv::util::toUTF8String(this->m_path.filename()), requestedVersion);
return false;
}