[LLVM-3.9] Use old way of getting next child
This was changed back in
aacf2fbf
This commit is contained in:
parent
d0e5aa4820
commit
f439aeef07
1 changed files with 7 additions and 2 deletions
|
@ -79,7 +79,12 @@ extern "C" RustArchiveIterator*
|
||||||
LLVMRustArchiveIteratorNew(RustArchive *ra) {
|
LLVMRustArchiveIteratorNew(RustArchive *ra) {
|
||||||
Archive *ar = ra->getBinary();
|
Archive *ar = ra->getBinary();
|
||||||
RustArchiveIterator *rai = new RustArchiveIterator();
|
RustArchiveIterator *rai = new RustArchiveIterator();
|
||||||
|
#if LLVM_VERSION_MINOR >= 9
|
||||||
|
Error err;
|
||||||
|
rai->cur = ar->child_begin(err);
|
||||||
|
#else
|
||||||
rai->cur = ar->child_begin();
|
rai->cur = ar->child_begin();
|
||||||
|
#endif
|
||||||
rai->end = ar->child_end();
|
rai->end = ar->child_end();
|
||||||
return rai;
|
return rai;
|
||||||
}
|
}
|
||||||
|
@ -88,8 +93,8 @@ extern "C" const Archive::Child*
|
||||||
LLVMRustArchiveIteratorNext(RustArchiveIterator *rai) {
|
LLVMRustArchiveIteratorNext(RustArchiveIterator *rai) {
|
||||||
if (rai->cur == rai->end)
|
if (rai->cur == rai->end)
|
||||||
return NULL;
|
return NULL;
|
||||||
#if LLVM_VERSION_MINOR >= 8
|
#if LLVM_VERSION_MINOR == 8
|
||||||
const ErrorOr<Archive::Child>* cur = rai->cur.operator->();
|
Archive::Child* cur = rai->cur.operator->();
|
||||||
if (!*cur) {
|
if (!*cur) {
|
||||||
LLVMRustSetLastError(cur->getError().message().c_str());
|
LLVMRustSetLastError(cur->getError().message().c_str());
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue