C++20 fixes

This commit is contained in:
SirLynix
2023-11-14 15:40:48 +01:00
parent e5789d1749
commit a4b10749f7
5 changed files with 8 additions and 6 deletions

View File

@@ -3,6 +3,7 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/Posix/DynLibImpl.hpp>
#include <NazaraUtils/Algorithm.hpp>
#include <dlfcn.h>
#include <cstring>
#include <Nazara/Core/Debug.hpp>
@@ -35,7 +36,7 @@ namespace Nz
bool DynLibImpl::Load(const std::filesystem::path& libraryPath, std::string* errorMessage)
{
dlerror(); // Clear error flag
m_handle = dlopen(libraryPath.generic_u8string().data(), RTLD_LAZY | RTLD_GLOBAL);
m_handle = dlopen(Nz::PathToString(libraryPath).data(), RTLD_LAZY | RTLD_GLOBAL);
if (!m_handle)
{

View File

@@ -3,6 +3,7 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/Posix/FileImpl.hpp>
#include <NazaraUtils/Algorithm.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/StringExt.hpp>
@@ -78,7 +79,7 @@ namespace Nz
if (mode & OpenMode::Truncate)
flags |= O_TRUNC;
int fileDescriptor = Open_def(filePath.generic_u8string().data(), flags, permissions);
int fileDescriptor = Open_def(Nz::PathToString(filePath).data(), flags, permissions);
if (fileDescriptor == -1)
{
NazaraErrorFmt("failed to open \"{0}\": {1}", filePath, Error::GetLastSystemError());