Skip to content

Commit

Permalink
[libromdata] WiiUPackage: Use _T() on some strings for Unicode on Win…
Browse files Browse the repository at this point in the history
…dows.

This should fix the Windows build.
  • Loading branch information
GerbilSoft committed Nov 17, 2024
1 parent b0d09c1 commit 01c28db
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/libromdata/Console/WiiUPackage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,18 @@ IRpFilePtr WiiUPackagePrivate::open(const char *filename)
filename++;
}

#ifdef _WIN32
const size_t old_sz = s_full_filename.size();
#endif /* _WIN32 */
s_full_filename += U82T_c(filename);
#ifdef _WIN32
// Replace all slashes with backslashes.
const auto start_iter = s_full_filename.begin() + old_sz;
std::transform(start_iter, s_full_filename.end(), start_iter, [](TCHAR c) {
return (c == '/') ? DIR_SEP_CHR : c;
});
#endif /* _WIN32 */

return std::make_shared<RpFile>(s_full_filename.c_str(), RpFile::FM_OPEN_READ);
}

Expand Down Expand Up @@ -388,7 +399,7 @@ void WiiUPackage::init(void)
tstring s_path(d->path);
s_path += DIR_SEP_CHR;
if (d->packageType == WiiUPackagePrivate::PackageType::Extracted) {
s_path += "code";
s_path += _T("code");
s_path += DIR_SEP_CHR;
}
s_path += _T("title.tik");
Expand Down Expand Up @@ -422,7 +433,7 @@ void WiiUPackage::init(void)

s_path.resize(s_path.size()-9);
if (d->packageType == WiiUPackagePrivate::PackageType::Extracted) {
s_path += "code";
s_path += _T("code");
s_path += DIR_SEP_CHR;
}
s_path += _T("title.tmd");
Expand Down

0 comments on commit 01c28db

Please sign in to comment.