Skip to content

Commit caedb36

Browse files
committed
llvm6: Different return value for writeArchive
Updated in llvm-mirror/llvm@203c90ba this function now just returns an `Error`, so this updates the C++ bindings accordingly
1 parent b6fe112 commit caedb36

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/rustllvm/ArchiveWrapper.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,16 @@ LLVMRustWriteArchive(char *Dst, size_t NumMembers,
232232
Members.push_back(std::move(*MOrErr));
233233
}
234234
}
235-
auto Pair = writeArchive(Dst, Members, WriteSymbtab, Kind, true, false);
236-
if (!Pair.second)
235+
auto Result = writeArchive(Dst, Members, WriteSymbtab, Kind, true, false);
236+
#if LLVM_VERSION_GE(6, 0)
237+
if (!Result)
237238
return LLVMRustResult::Success;
238-
LLVMRustSetLastError(Pair.second.message().c_str());
239+
LLVMRustSetLastError(toString(std::move(Result)).c_str());
240+
#else
241+
if (!Result.second)
242+
return LLVMRustResult::Success;
243+
LLVMRustSetLastError(Result.second.message().c_str());
244+
#endif
245+
239246
return LLVMRustResult::Failure;
240247
}

0 commit comments

Comments
 (0)