diff --git a/ecsact/codegen/plugin.hh b/ecsact/codegen/plugin.hh index 4af76c2..1597794 100644 --- a/ecsact/codegen/plugin.hh +++ b/ecsact/codegen/plugin.hh @@ -6,9 +6,7 @@ #include #include #include -#ifdef __cpp_lib_format -# include -#endif +#include #include "ecsact/runtime/common.h" #include "ecsact/codegen/plugin.h" @@ -106,37 +104,35 @@ struct codegen_plugin_context { } } -#ifdef __cpp_lib_format template auto writef(std::format_string fmt, Args&&... args) { - auto str = std::format(fmt, std::make_format_args(args...)); + auto str = std::format(fmt, std::forward(args)...); write_(str.data(), static_cast(str.size())); } template auto info(std::format_string fmt, Args&&... args) { - auto str = std::format(fmt, std::make_format_args(args...)); + auto str = std::format(fmt, std::forward(args)...); report_(ECSACT_CODEGEN_REPORT_INFO, str.data(), str.size()); } template auto warn(std::format_string fmt, Args&&... args) { - auto str = std::format(fmt, std::make_format_args(args...)); + auto str = std::format(fmt, std::forward(args)...); report_(ECSACT_CODEGEN_REPORT_WARNING, str.data(), str.size()); } template auto error(std::format_string fmt, Args&&... args) { - auto str = std::format(fmt, std::make_format_args(args...)); + auto str = std::format(fmt, std::forward(args)...); report_(ECSACT_CODEGEN_REPORT_ERROR, str.data(), str.size()); } template auto fatal(std::format_string fmt, Args&&... args) { - auto str = std::format(fmt, std::make_format_args(args...)); + auto str = std::format(fmt, std::forward(args)...); report_(ECSACT_CODEGEN_REPORT_FATAL, str.data(), str.size()); } -#endif }; } // namespace ecsact