From 091249dff4c696c5b45a04800963081f5431fa5f Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Sun, 25 Sep 2022 02:47:00 +0800 Subject: [PATCH] aco: Fixes compiling error about char8_t with c++20 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The error is: ../mesa/src/amd/compiler/aco_register_allocation.cpp:382:7: error: no matching function for call to 'printf' printf(u8"☐"); Fixes: 209a89e51d1 ("aco: Convert to use u8 literal for Unicode character to fixes msvc warning") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7318 Signed-off-by: Yonggang Luo Reviewed-by: Daniel Schürmann Reviewed-by: Samuel Pitoiset Tested-by: Marcus Seyfarth Part-of: --- src/amd/compiler/aco_register_allocation.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index 437cf49..84a070b 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -379,11 +379,11 @@ UNUSED void print_reg(const RegisterFile& reg_file, PhysReg reg, bool has_adjacent_variable) { if (reg_file[reg] == 0xFFFFFFFF) { - printf(u8"☐"); + printf((const char*)u8"☐"); } else if (reg_file[reg]) { const bool show_subdword_alloc = (reg_file[reg] == 0xF0000000); if (show_subdword_alloc) { - const char* block_chars[] = { + auto block_chars = { // clang-format off u8"?", u8"▘", u8"▝", u8"▀", u8"▖", u8"▌", u8"▞", u8"▛", @@ -397,18 +397,18 @@ print_reg(const RegisterFile& reg_file, PhysReg reg, bool has_adjacent_variable) index |= 1 << i; } } - printf("%s", block_chars[index]); + printf("%s", (const char*)(block_chars.begin()[index])); } else { /* Indicate filled register slot */ if (!has_adjacent_variable) { - printf(u8"█"); + printf((const char*)u8"█"); } else { /* Use a slightly shorter box to leave a small gap between adjacent variables */ - printf(u8"▉"); + printf((const char*)u8"▉"); } } } else { - printf(u8"·"); + printf((const char*)u8"·"); } } -- 2.7.4