From 876023ffa947936b7e23f221c0c8e65d93efca9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leclercq?= Date: Mon, 4 Dec 2023 00:38:10 +0100 Subject: [PATCH] Core: Fix use of std::bit_cast --- src/Nazara/Core/Posix/DynLibImpl.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Nazara/Core/Posix/DynLibImpl.cpp b/src/Nazara/Core/Posix/DynLibImpl.cpp index 0d4b6ff3e..32d257a70 100644 --- a/src/Nazara/Core/Posix/DynLibImpl.cpp +++ b/src/Nazara/Core/Posix/DynLibImpl.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include #include @@ -25,15 +24,13 @@ namespace Nz if (!ptr) *errorMessage = dlerror(); - static_assert(sizeof(DynLibFunc) == sizeof(void*)); - - return std::bit_cast(ptr); + return BitCast(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) {