@@ -36,29 +36,55 @@ pub enum IntKind {
36
36
/// An `unsigned long long`.
37
37
ULongLong ,
38
38
39
+ /// A 8-bit signed integer.
40
+ I8 ,
41
+
42
+ /// A 8-bit unsigned integer.
43
+ U8 ,
44
+
45
+ /// A 16-bit signed integer.
46
+ I16 ,
47
+
39
48
/// Either a `char16_t` or a `wchar_t`.
40
49
U16 ,
41
50
42
- /// A `char32_t`.
51
+ /// A 32-bit signed integer.
52
+ I32 ,
53
+
54
+ /// A 32-bit unsigned integer.
43
55
U32 ,
44
56
57
+ /// A 64-bit signed integer.
58
+ I64 ,
59
+
60
+ /// A 64-bit unsigned integer.
61
+ U64 ,
62
+
45
63
/// An `int128_t`
46
64
I128 ,
47
65
48
66
/// A `uint128_t`.
49
- U128 , /* Though now we're at it we could add equivalents for the rust
50
- * types... */
67
+ U128 ,
68
+
69
+ /// A custom integer type, used to allow custom macro types depending on
70
+ /// range.
71
+ ///
72
+ /// The boolean means a whether this is a signed integer type or not.
73
+ Custom ( & ' static str , bool ) ,
51
74
}
52
75
53
76
impl IntKind {
54
77
/// Is this integral type signed?
55
78
pub fn is_signed ( & self ) -> bool {
56
79
use self :: IntKind :: * ;
57
80
match * self {
58
- Bool | UChar | UShort | UInt | ULong | ULongLong | U16 | U32 |
59
- U128 => false ,
81
+ Bool | UChar | UShort | UInt | ULong | ULongLong | U8 | U16 |
82
+ U32 | U64 | U128 => false ,
83
+
84
+ Char | Short | Int | Long | LongLong | I8 | I16 | I32 | I64 |
85
+ I128 => true ,
60
86
61
- Char | Short | Int | Long | LongLong | I128 => true ,
87
+ Custom ( _ , signed ) => signed ,
62
88
}
63
89
}
64
90
}
0 commit comments