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

@ -124,7 +124,7 @@ int main()
for (auto&& headerFile : std::filesystem::recursive_directory_iterator(entry.path()))
{
if (!headerFile.is_regular_file() || headerFile.path().extension().generic_u8string() != ".hpp")
if (!headerFile.is_regular_file() || Nz::PathToString(headerFile.path().extension()) != ".hpp")
continue;
std::string filepath = Nz::PathToString(headerFile.path());

View File

@ -33,7 +33,7 @@ int main()
continue;
const std::filesystem::path& filePath = p.path();
if (Nz::MeshLoader::IsExtensionSupported(filePath.extension().generic_u8string())) // L'extension est-elle supportée par le MeshLoader ?
if (Nz::MeshLoader::IsExtensionSupported(Nz::PathToString(filePath.extension()))) // L'extension est-elle supportée par le MeshLoader ?
models.push_back(filePath);
}

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());

View File

@ -38,8 +38,8 @@ SCENARIO("EulerAngles", "[MATH][EULERANGLES]")
THEN("They are the same")
{
CHECK(firstZero.ToQuaternion() == secondZero.ToQuaternion());
CHECK(firstZero.ToQuaternion() == Nz::EulerAnglesf(Nz::Quaternionf(1.f, 0.f, 0.f, 0.f)));
CHECK(secondZero.ToQuaternion() == Nz::EulerAnglesf(Nz::Quaternionf(1.f, 0.f, 0.f, 0.f)));
CHECK(firstZero.ToQuaternion() == Nz::Quaternionf(1.f, 0.f, 0.f, 0.f));
CHECK(secondZero.ToQuaternion() == Nz::Quaternionf(1.f, 0.f, 0.f, 0.f));
}
}
}