4 Definitions useful for C interop
8 FIXME: Add a test that uses some native code to verify these sizes,
9 which are not obviously correct for all potential platforms.
12 // PORT adapt to architecture
17 A signed integer with the same size as a C `int`
24 An unsigned integer with the same size as a C `unsigned int`
31 A signed integer with the same size as a C `long`
38 An unsigned integer with the same size as a C `unsigned int`
45 An unsigned integer with the same size as a C `unsigned long`
52 A signed integer with the same size as a pointer. This is
53 guaranteed to always be the same type as a Rust `int`
55 type intptr_t = uint; // FIXME: int
60 An unsigned integer with the same size as a pointer. This is
61 guaranteed to always be the same type as a Rust `uint`.
63 type uintptr_t = uint;
69 A type, a pointer to which can be used as C `void *`
71 Note that this does not directly correspond to the C `void` type,
72 which is an incomplete type. Using pointers to this type
73 when interoperating with C void pointers can help in documentation.
80 A float value with the same size as a C `float`
87 A float value with the same size as a C `double`
94 An unsigned integer corresponding to the C `size_t`
101 A signed integer correpsonding to the C `ssize_t`
108 An unsigned integer corresponding to the C `off_t`
115 A type that can be used for C file descriptors
117 type fd_t = i32; // not actually a C type, but should be.
122 A type for representing process ID's, corresponding to C `pid_t`
126 // enum is implementation-defined, but is 32-bits in practice
130 An unsigned integer with the same size as a C enum