From 30b1fceaf24df514f5acca68653e01c98f2f8176 Mon Sep 17 00:00:00 2001 From: M0liusX Date: Thu, 27 Apr 2023 12:53:43 -0500 Subject: [PATCH] Fix MSVC v143 errors with fmt --- src/main.cpp | 4 ++-- src/recompilation.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c2c3618..5fca1db 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -985,7 +985,7 @@ bool read_list_file(const std::filesystem::path& filename, std::unordered_set= func_vram + func.words.size() * sizeof(func.words[0])) { - exit_failure(fmt::format("Function {} has an instruction patch for vram 0x{:08X} but doesn't contain that vram address!", patch.vram)); + exit_failure(fmt::vformat("Function {} has an instruction patch for vram 0x{:08X} but doesn't contain that vram address!", fmt::make_format_args(patch.vram))); } // Calculate the instruction index and modify the instruction. diff --git a/src/recompilation.cpp b/src/recompilation.cpp index 5abdfe3..9537c63 100644 --- a/src/recompilation.cpp +++ b/src/recompilation.cpp @@ -78,12 +78,12 @@ bool process_instruction(const RecompPort::Context& context, const RecompPort::F auto print_line = [&](fmt::format_string fmt_str, Ts ...args) { print_indent(); - fmt::print(output_file, fmt_str, args...); + fmt::vprint(output_file, fmt_str, fmt::make_format_args(args...)); fmt::print(output_file, ";\n"); }; auto print_branch_condition = [&](fmt::format_string fmt_str, Ts ...args) { - fmt::print(output_file, fmt_str, args...); + fmt::vprint(output_file, fmt_str, fmt::make_format_args(args...)); fmt::print(output_file, " "); }; @@ -99,7 +99,7 @@ bool process_instruction(const RecompPort::Context& context, const RecompPort::F process_instruction(context, func, stats, skipped_insns, instr_index + 1, instructions, output_file, false, false, link_branch_index, next_reloc_index, dummy_needs_link_branch, dummy_is_branch_likely, static_funcs_out); } print_indent(); - fmt::print(output_file, fmt_str, args...); + fmt::vprint(output_file, fmt_str, fmt::make_format_args(args...)); if (needs_link_branch) { fmt::print(output_file, ";\n goto after_{};\n", link_branch_index); } else { @@ -120,7 +120,7 @@ bool process_instruction(const RecompPort::Context& context, const RecompPort::F process_instruction(context, func, stats, skipped_insns, instr_index + 1, instructions, output_file, true, false, link_branch_index, next_reloc_index, dummy_needs_link_branch, dummy_is_branch_likely, static_funcs_out); } fmt::print(output_file, " "); - fmt::print(output_file, fmt_str, args...); + fmt::vprint(output_file, fmt_str, fmt::make_format_args(args...)); if (needs_link_branch) { fmt::print(output_file, ";\n goto after_{}", link_branch_index); }