fix: wide string literals for url_prefix concatenation on Windows

The Windows path builds url_prefix as a wide string.

MSVC accepts concatenating the narrow literals here, but clang-cl rejects the
mixed narrow/wide expression. Use wide literals so the concatenation type matches.
This commit is contained in:
Gabriel
2026-06-24 00:36:42 -03:00
parent 9e635925c8
commit 7aaeea2bd2

View File

@@ -9224,7 +9224,7 @@ bool GUI_App::check_url_association(std::wstring url_prefix, std::wstring& reg_b
{
reg_bin = L"";
#ifdef WIN32
wxRegKey key_full(wxRegKey::HKCU, "Software\\Classes\\" + url_prefix + "\\shell\\open\\command");
wxRegKey key_full(wxRegKey::HKCU, L"Software\\Classes\\" + url_prefix + L"\\shell\\open\\command");
if (!key_full.Exists()) {
return false;
}
@@ -9250,8 +9250,8 @@ void GUI_App::associate_url(std::wstring url_prefix)
wxString key_string = "\"" + wbinary + "\" \"%1\"";
wxRegKey key_first(wxRegKey::HKCU, "Software\\Classes\\" + url_prefix);
wxRegKey key_full(wxRegKey::HKCU, "Software\\Classes\\" + url_prefix + "\\shell\\open\\command");
wxRegKey key_first(wxRegKey::HKCU, L"Software\\Classes\\" + url_prefix);
wxRegKey key_full(wxRegKey::HKCU, L"Software\\Classes\\" + url_prefix + L"\\shell\\open\\command");
if (!key_first.Exists()) {
key_first.Create(false);
}
@@ -9271,7 +9271,7 @@ void GUI_App::disassociate_url(std::wstring url_prefix)
#ifdef WIN32
if (is_running_in_msix())
return;
wxRegKey key_full(wxRegKey::HKCU, "Software\\Classes\\" + url_prefix + "\\shell\\open\\command");
wxRegKey key_full(wxRegKey::HKCU, L"Software\\Classes\\" + url_prefix + L"\\shell\\open\\command");
if (!key_full.Exists()) {
return;
}