Split error macro into two versions (format vs non-formating) to allow format checking at compile-time
This commit is contained in:
@@ -11,9 +11,29 @@
|
||||
#include <Nazara/Core/Config.hpp>
|
||||
#include <string>
|
||||
|
||||
#ifdef NAZARA_BUILD
|
||||
|
||||
#include <fmt/compile.h>
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/std.h>
|
||||
|
||||
#define NAZARA_FORMAT(s) FMT_STRING(s)
|
||||
|
||||
#else
|
||||
|
||||
#define NAZARA_FORMAT(s) s
|
||||
|
||||
#endif
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
template<typename... Args> std::string Format(std::string_view str, Args&&... args);
|
||||
#ifdef NAZARA_BUILD
|
||||
template<typename... Args> using FormatString = fmt::format_string<Args...>;
|
||||
#else
|
||||
template<typename... Args> using FormatString = std::string_view;
|
||||
#endif
|
||||
|
||||
template<typename... Args> std::string Format(FormatString<Args...> str, Args&&... args);
|
||||
}
|
||||
|
||||
#include <Nazara/Core/Format.inl>
|
||||
|
||||
Reference in New Issue
Block a user