Split error macro into two versions (format vs non-formating) to allow format checking at compile-time

This commit is contained in:
SirLynix
2023-11-02 15:18:03 +01:00
parent 8fb53f467b
commit 4b8a475bbd
133 changed files with 570 additions and 557 deletions

View File

@@ -69,7 +69,7 @@ namespace Nz
std::string extension = ToLower(PathToString(filePath.extension()));
if (extension.empty())
{
NazaraError("failed to get file extension from \"{0}\"", filePath);
NazaraErrorFmt("failed to get file extension from \"{0}\"", filePath);
return false;
}
@@ -93,7 +93,7 @@ namespace Nz
if (!file.Open(OpenMode::WriteOnly | OpenMode::Truncate))
{
NazaraError("failed to save to file: unable to open \"{0}\" in write mode", filePath);
NazaraErrorFmt("failed to save to file: unable to open \"{0}\" in write mode", filePath);
return false;
}
@@ -107,7 +107,7 @@ namespace Nz
if (found)
NazaraError("failed to save resource: all savers failed");
else
NazaraError("failed to save resource: no saver found for extension \"extension\"", extension);
NazaraErrorFmt("failed to save resource: no saver found for extension \"extension\"", extension);
return false;
}
@@ -152,7 +152,7 @@ namespace Nz
if (found)
NazaraError("failed to save resource: all savers failed");
else
NazaraError("failed to save resource: no saver found for format \"{0}\"", format);
NazaraErrorFmt("failed to save resource: no saver found for format \"{0}\"", format);
return false;
}