mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Rollup merge of #134204 - Zalathar:llvm-bool, r=SparrowLii
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. https://github.com/rust-lang/llvm-project/blob/1268e87/llvm/include/llvm-c/Types.h#L28
This commit is contained in:
commit
6d79df6867
@ -17,7 +17,9 @@ use super::debuginfo::{
|
|||||||
DebugEmissionKind, DebugNameTableKind,
|
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 True: Bool = 1 as Bool;
|
||||||
pub const False: Bool = 0 as Bool;
|
pub const False: Bool = 0 as Bool;
|
||||||
|
Loading…
Reference in New Issue
Block a user