Core: Fix use of std::bit_cast

This commit is contained in:
Jérôme Leclercq 2023-12-04 00:38:10 +01:00 committed by GitHub
parent f75a00efe2
commit 876023ffa9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -5,7 +5,6 @@
#include <Nazara/Core/Posix/DynLibImpl.hpp>
#include <NazaraUtils/Algorithm.hpp>
#include <dlfcn.h>
#include <bit>
#include <cstring>
#include <Nazara/Core/Debug.hpp>
@ -25,15 +24,13 @@ namespace Nz
if (!ptr)
*errorMessage = dlerror();
static_assert(sizeof(DynLibFunc) == sizeof(void*));
return std::bit_cast<DynLibFunc>(ptr);
return BitCast<DynLibFunc>(ptr);
}
bool DynLibImpl::Load(const std::filesystem::path& libraryPath, std::string* errorMessage)
{
dlerror(); // Clear error flag
m_handle = dlopen(Nz::PathToString(libraryPath).data(), RTLD_LAZY | RTLD_GLOBAL);
m_handle = dlopen(PathToString(libraryPath).data(), RTLD_LAZY | RTLD_GLOBAL);
if (!m_handle)
{