|
3 | 3 | //! This module is intentionally standalone to facilitate parsing when retrieving
|
4 | 4 | //! core C types.
|
5 | 5 |
|
6 |
| -macro_rules! type_alias { |
7 |
| - { |
8 |
| - $Docfile:tt, $Alias:ident = $Real:ty; |
9 |
| - $( $Cfg:tt )* |
10 |
| - } => { |
11 |
| - #[doc = include_str!($Docfile)] |
12 |
| - $( $Cfg )* |
13 |
| - #[stable(feature = "core_ffi_c", since = "1.64.0")] |
14 |
| - pub type $Alias = $Real; |
15 |
| - } |
16 |
| -} |
| 6 | +pub(super) type c_char = c_char_definition::c_char; |
17 | 7 |
|
18 |
| -type_alias! { "c_char.md", c_char = c_char_definition::c_char; #[doc(cfg(all()))] } |
| 8 | +pub(super) type c_schar = i8; |
| 9 | +pub(super) type c_uchar = u8; |
19 | 10 |
|
20 |
| -type_alias! { "c_schar.md", c_schar = i8; } |
21 |
| -type_alias! { "c_uchar.md", c_uchar = u8; } |
22 |
| -type_alias! { "c_short.md", c_short = i16; } |
23 |
| -type_alias! { "c_ushort.md", c_ushort = u16; } |
| 11 | +pub(super) type c_short = i16; |
| 12 | +pub(super) type c_ushort = u16; |
24 | 13 |
|
25 |
| -type_alias! { "c_int.md", c_int = c_int_definition::c_int; #[doc(cfg(all()))] } |
26 |
| -type_alias! { "c_uint.md", c_uint = c_int_definition::c_uint; #[doc(cfg(all()))] } |
| 14 | +pub(super) type c_int = c_int_definition::c_int; |
| 15 | +pub(super) type c_uint = c_int_definition::c_uint; |
27 | 16 |
|
28 |
| -type_alias! { "c_long.md", c_long = c_long_definition::c_long; #[doc(cfg(all()))] } |
29 |
| -type_alias! { "c_ulong.md", c_ulong = c_long_definition::c_ulong; #[doc(cfg(all()))] } |
| 17 | +pub(super) type c_long = c_long_definition::c_long; |
| 18 | +pub(super) type c_ulong = c_long_definition::c_ulong; |
30 | 19 |
|
31 |
| -type_alias! { "c_longlong.md", c_longlong = i64; } |
32 |
| -type_alias! { "c_ulonglong.md", c_ulonglong = u64; } |
| 20 | +pub(super) type c_longlong = i64; |
| 21 | +pub(super) type c_ulonglong = u64; |
33 | 22 |
|
34 |
| -type_alias! { "c_float.md", c_float = f32; } |
35 |
| -type_alias! { "c_double.md", c_double = f64; } |
| 23 | +pub(super) type c_float = f32; |
| 24 | +pub(super) type c_double = f64; |
36 | 25 |
|
37 | 26 | mod c_char_definition {
|
38 | 27 | crate::cfg_select! {
|
@@ -150,26 +139,9 @@ mod c_long_definition {
|
150 | 139 | }
|
151 | 140 | }
|
152 | 141 |
|
153 |
| -/// Equivalent to C's `size_t` type, from `stddef.h` (or `cstddef` for C++). |
154 |
| -/// |
155 |
| -/// This type is currently always [`usize`], however in the future there may be |
156 |
| -/// platforms where this is not the case. |
157 |
| -#[unstable(feature = "c_size_t", issue = "88345")] |
158 |
| -pub type c_size_t = usize; |
159 |
| - |
160 |
| -/// Equivalent to C's `ptrdiff_t` type, from `stddef.h` (or `cstddef` for C++). |
161 |
| -/// |
162 |
| -/// This type is currently always [`isize`], however in the future there may be |
163 |
| -/// platforms where this is not the case. |
164 |
| -#[unstable(feature = "c_size_t", issue = "88345")] |
165 |
| -pub type c_ptrdiff_t = isize; |
166 |
| - |
167 |
| -/// Equivalent to C's `ssize_t` (on POSIX) or `SSIZE_T` (on Windows) type. |
168 |
| -/// |
169 |
| -/// This type is currently always [`isize`], however in the future there may be |
170 |
| -/// platforms where this is not the case. |
171 |
| -#[unstable(feature = "c_size_t", issue = "88345")] |
172 |
| -pub type c_ssize_t = isize; |
| 142 | +pub(super) type c_size_t = usize; |
| 143 | +pub(super) type c_ptrdiff_t = isize; |
| 144 | +pub(super) type c_ssize_t = isize; |
173 | 145 |
|
174 | 146 | mod c_int_definition {
|
175 | 147 | crate::cfg_select! {
|
|
0 commit comments