Core: Fix use of std::bit_cast
This commit is contained in:
parent
f75a00efe2
commit
876023ffa9
|
|
@ -5,7 +5,6 @@
|
||||||
#include <Nazara/Core/Posix/DynLibImpl.hpp>
|
#include <Nazara/Core/Posix/DynLibImpl.hpp>
|
||||||
#include <NazaraUtils/Algorithm.hpp>
|
#include <NazaraUtils/Algorithm.hpp>
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#include <bit>
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <Nazara/Core/Debug.hpp>
|
#include <Nazara/Core/Debug.hpp>
|
||||||
|
|
||||||
|
|
@ -25,15 +24,13 @@ namespace Nz
|
||||||
if (!ptr)
|
if (!ptr)
|
||||||
*errorMessage = dlerror();
|
*errorMessage = dlerror();
|
||||||
|
|
||||||
static_assert(sizeof(DynLibFunc) == sizeof(void*));
|
return BitCast<DynLibFunc>(ptr);
|
||||||
|
|
||||||
return std::bit_cast<DynLibFunc>(ptr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DynLibImpl::Load(const std::filesystem::path& libraryPath, std::string* errorMessage)
|
bool DynLibImpl::Load(const std::filesystem::path& libraryPath, std::string* errorMessage)
|
||||||
{
|
{
|
||||||
dlerror(); // Clear error flag
|
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)
|
if (!m_handle)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue