fix building against recent LLVM 4.0

This commit is contained in:
Rainer Schuetze 2016-10-03 10:26:24 +02:00
parent 47e1251298
commit 8f0f29c239
3 changed files with 20 additions and 4 deletions

View file

@ -66,6 +66,9 @@ static bool ReadPathFromRegistry(llvm::SmallString<128> &p) {
if (RegGetValue(hkey, NULL, _T("Path"), RRF_RT_REG_SZ, NULL, data, &length) ==
ERROR_SUCCESS) {
#if UNICODE
#if LDC_LLVM_VER >= 400
using UTF16 = llvm::UTF16;
#endif
std::string out;
res = llvm::convertUTF16ToUTF8String(
llvm::ArrayRef<UTF16>(reinterpret_cast<UTF16 *>(data), length), out);