1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* <stddef.h> — common definitions (C99 7.17).
*
* One of the bundled headers cinrs ships instead of reading the platform's
* own: see the crate documentation for why. The widths below come from the
* target description macros the preprocessor predefines, so the same text
* serves every data model cinrs knows about.
*/
/* `__SIZE_TYPE__` and its relatives are what the front end itself uses for
* these types, predefined from the target model, so writing the typedefs in
* terms of them is what keeps `sizeof` and `size_t` the same type on every
* target: `unsigned int` on i686, `unsigned long` on LP64, `unsigned long
* long` on 64-bit Windows. `__extension__` says "an extension, and I know it",
* so that a `c89!` block including this one is not told off for the `long
* long` the last of those expands to. */
__extension__ typedef __SIZE_TYPE__ size_t;
__extension__ typedef __PTRDIFF_TYPE__ ptrdiff_t;
/* `wchar_t` is `int` on the Unix platforms, `unsigned int` on Arm and
* `unsigned short` on Windows; `__WCHAR_TYPE__` is whichever this target has,
* and is the same type the front end gives `L'x'` and `L"…"`. */
typedef __WCHAR_TYPE__ wchar_t;
/* `offsetof` is a compiler builtin here, and the front end folds it to an
* integer constant out of the layout it computed for the record — so it is an
* integer constant expression and may be an array bound, a `case` label or the
* initialiser of a file-scope object, and a nested member designator
* (`a.b`, `a[2].b`, a member of an anonymous member) works as C99 7.17p3
* describes. That the value agrees with the offset the generated `#[repr(C)]`
* item really has is checked against Rust's `core::mem::offset_of!`. */
/* C23's `nullptr_t`. cinrs gives `nullptr` the type `void *` rather than a
* type of its own, so this is what the name stands for; the difference shows
* only in the places C distinguishes them, such as `_Generic`. */
typedef void *nullptr_t;
/* `unreachable()` promises control never gets here, and cinrs takes the
* promise literally: it becomes `core::hint::unreachable_unchecked()`, so
* reaching it is undefined behaviour exactly as C says it is. */
/* _CINRS_STDDEF_H */