Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bindgen/codegen/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ pub(crate) mod ast_ty {
IntKind::U32 => syn::parse_quote! { u32 },
IntKind::I64 => syn::parse_quote! { i64 },
IntKind::U64 => syn::parse_quote! { u64 },
IntKind::Isize => syn::parse_quote! { isize },
IntKind::Usize => syn::parse_quote! { usize },
IntKind::Custom { name, .. } => {
syn::parse_str(name).expect("Invalid integer type.")
}
Expand Down
10 changes: 8 additions & 2 deletions bindgen/ir/int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ pub enum IntKind {
/// A `uint128_t`.
U128,

/// A pointer-sized signed integer.
Isize,

/// A pointer-sized unsigned integer.
Usize,

/// A custom integer type, used to allow custom macro types depending on
/// range.
Custom {
Expand All @@ -97,10 +103,10 @@ impl IntKind {
// to know whether it is or not right now (unlike char, there's no
// WChar_S / WChar_U).
Bool | UChar | UShort | UInt | ULong | ULongLong | U8 | U16 |
Char16 | WChar | U32 | U64 | U128 => false,
Char16 | WChar | U32 | U64 | U128 | Usize => false,

SChar | Short | Int | Long | LongLong | I8 | I16 | I32 | I64 |
I128 => true,
I128 | Isize => true,

Char { is_signed } | Custom { is_signed, .. } => is_signed,
}
Expand Down
Loading