Skip to content

Commit fb08ef4

Browse files
committed
Tweak rustllvm bindings to work on linux, where bool != LLVMBool.
1 parent 24a75ee commit fb08ef4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/rustllvm/Object.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ void LLVMDisposeSectionIterator(LLVMSectionIteratorRef SI) {
3535
delete unwrap(SI);
3636
}
3737

38-
bool LLVMIsSectionIteratorAtEnd(LLVMObjectFileRef ObjectFile,
38+
LLVMBool LLVMIsSectionIteratorAtEnd(LLVMObjectFileRef ObjectFile,
3939
LLVMSectionIteratorRef SI) {
40-
return *unwrap(SI) == unwrap(ObjectFile)->end_sections();
40+
return (*unwrap(SI) == unwrap(ObjectFile)->end_sections()) ? 1 : 0;
4141
}
4242

4343
void LLVMMoveToNextSection(LLVMSectionIteratorRef SI) {

src/rustllvm/include/llvm-c/Object.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void LLVMDisposeObjectFile(LLVMObjectFileRef ObjectFile);
3838

3939
LLVMSectionIteratorRef LLVMGetSections(LLVMObjectFileRef ObjectFile);
4040
void LLVMDisposeSectionIterator(LLVMSectionIteratorRef SI);
41-
bool LLVMIsSectionIteratorAtEnd(LLVMObjectFileRef ObjectFile,
41+
LLVMBool LLVMIsSectionIteratorAtEnd(LLVMObjectFileRef ObjectFile,
4242
LLVMSectionIteratorRef SI);
4343
void LLVMMoveToNextSection(LLVMSectionIteratorRef SI);
4444
const char *LLVMGetSectionName(LLVMSectionIteratorRef SI);

0 commit comments

Comments
 (0)