Fix our llvm::Bool
typedef to be signed, to match LLVMBool
In the LLVM-C API, boolean values are passed as `typedef int LLVMBool`, but our Rust-side typedef was using `c_uint` instead. Signed and unsigned integers have the same ABI on most platforms, but that isn't universally true, so we should prefer to be consistent with LLVM.
This commit is contained in:
parent
903d2976fd
commit
f7c6a2cf11
1 changed files with 3 additions and 1 deletions
|
@ -17,7 +17,9 @@ use super::debuginfo::{
|
|||
DebugEmissionKind, DebugNameTableKind,
|
||||
};
|
||||
|
||||
pub type Bool = c_uint;
|
||||
/// In the LLVM-C API, boolean values are passed as `typedef int LLVMBool`,
|
||||
/// which has a different ABI from Rust or C++ `bool`.
|
||||
pub type Bool = c_int;
|
||||
|
||||
pub const True: Bool = 1 as Bool;
|
||||
pub const False: Bool = 0 as Bool;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue