[LLVM-3.9] Update return type for Archive::create
Changed in
0b21d88fd3
This commit is contained in:
parent
8433f9bb33
commit
dbb4178f4e
1 changed files with 8 additions and 0 deletions
|
@ -43,11 +43,19 @@ LLVMRustOpenArchive(char *path) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if LLVM_VERSION_MINOR <= 8
|
||||||
ErrorOr<std::unique_ptr<Archive>> archive_or =
|
ErrorOr<std::unique_ptr<Archive>> archive_or =
|
||||||
|
#else
|
||||||
|
Expected<std::unique_ptr<Archive>> archive_or =
|
||||||
|
#endif
|
||||||
Archive::create(buf_or.get()->getMemBufferRef());
|
Archive::create(buf_or.get()->getMemBufferRef());
|
||||||
|
|
||||||
if (!archive_or) {
|
if (!archive_or) {
|
||||||
|
#if LLVM_VERSION_MINOR <= 8
|
||||||
LLVMRustSetLastError(archive_or.getError().message().c_str());
|
LLVMRustSetLastError(archive_or.getError().message().c_str());
|
||||||
|
#else
|
||||||
|
LLVMRustSetLastError(toString(archive_or.takeError()).c_str());
|
||||||
|
#endif
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue