mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-19 04:28:20 +00:00
Avoid usage of char16_t as MSVC "14" doesn't appear to support it
Fixes the MSVC "14" build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221932 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -39,13 +39,13 @@ ErrorOr<std::string> sys::findProgramByName(StringRef Name,
|
|||||||
if (Name.find_first_of("/\\") != StringRef::npos)
|
if (Name.find_first_of("/\\") != StringRef::npos)
|
||||||
return std::string(Name);
|
return std::string(Name);
|
||||||
|
|
||||||
const char16_t *Path = nullptr;
|
const wchar_t *Path = nullptr;
|
||||||
std::u16string PathStorage;
|
std::wstring PathStorage;
|
||||||
if (!Paths.empty()) {
|
if (!Paths.empty()) {
|
||||||
PathStorage.reserve(Paths.size() * MAX_PATH);
|
PathStorage.reserve(Paths.size() * MAX_PATH);
|
||||||
for (unsigned i = 0; i < Paths.size(); ++i) {
|
for (unsigned i = 0; i < Paths.size(); ++i) {
|
||||||
if (i)
|
if (i)
|
||||||
PathStorage.push_back(';');
|
PathStorage.push_back(L';');
|
||||||
StringRef P = Paths[i];
|
StringRef P = Paths[i];
|
||||||
SmallVector<wchar_t, MAX_PATH> TmpPath;
|
SmallVector<wchar_t, MAX_PATH> TmpPath;
|
||||||
if (std::error_code EC = windows::UTF8ToUTF16(P, TmpPath))
|
if (std::error_code EC = windows::UTF8ToUTF16(P, TmpPath))
|
||||||
@@ -73,7 +73,7 @@ ErrorOr<std::string> sys::findProgramByName(StringRef Name,
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
U16Result.reserve(Len);
|
U16Result.reserve(Len);
|
||||||
Len = ::SearchPathW((const wchar_t *)Path, c_str(U16Name),
|
Len = ::SearchPathW(Path, c_str(U16Name),
|
||||||
U16Ext.empty() ? nullptr : c_str(U16Ext),
|
U16Ext.empty() ? nullptr : c_str(U16Ext),
|
||||||
U16Result.capacity(), U16Result.data(), nullptr);
|
U16Result.capacity(), U16Result.data(), nullptr);
|
||||||
} while (Len > U16Result.capacity());
|
} while (Len > U16Result.capacity());
|
||||||
|
Reference in New Issue
Block a user