1 //! Platform-specific types, as defined by C.
3 //! Code that interacts via FFI will almost certainly be using the
4 //! base types provided by C, which aren't nearly as nicely defined
5 //! as Rust's primitive types. This module provides types which will
6 //! match those defined by C, so that code that interacts with C will
7 //! refer to the correct types.
9 #![stable(feature = "raw_os", since = "1.1.0")]
14 #[doc(include = "char.md")]
19 target_arch = "aarch64",
21 target_arch = "hexagon",
22 target_arch = "powerpc",
23 target_arch = "powerpc64",
24 target_arch = "s390x",
25 target_arch = "riscv64",
26 target_arch = "riscv32"
29 all(target_os = "android", any(target_arch = "aarch64", target_arch = "arm")),
30 all(target_os = "l4re", target_arch = "x86_64"),
32 target_os = "freebsd",
34 target_arch = "aarch64",
36 target_arch = "powerpc",
37 target_arch = "powerpc64"
42 any(target_arch = "aarch64", target_arch = "arm", target_arch = "powerpc")
44 all(target_os = "openbsd", target_arch = "aarch64"),
46 target_os = "vxworks",
48 target_arch = "aarch64",
50 target_arch = "powerpc64",
51 target_arch = "powerpc"
54 all(target_os = "fuchsia", target_arch = "aarch64")
56 #[stable(feature = "raw_os", since = "1.1.0")]
58 #[doc(include = "char.md")]
63 target_arch = "aarch64",
65 target_arch = "hexagon",
66 target_arch = "powerpc",
67 target_arch = "powerpc64",
68 target_arch = "s390x",
69 target_arch = "riscv64",
70 target_arch = "riscv32"
73 all(target_os = "android", any(target_arch = "aarch64", target_arch = "arm")),
74 all(target_os = "l4re", target_arch = "x86_64"),
76 target_os = "freebsd",
78 target_arch = "aarch64",
80 target_arch = "powerpc",
81 target_arch = "powerpc64"
86 any(target_arch = "aarch64", target_arch = "arm", target_arch = "powerpc")
88 all(target_os = "openbsd", target_arch = "aarch64"),
90 target_os = "vxworks",
92 target_arch = "aarch64",
94 target_arch = "powerpc64",
95 target_arch = "powerpc"
98 all(target_os = "fuchsia", target_arch = "aarch64")
100 #[stable(feature = "raw_os", since = "1.1.0")]
101 pub type c_char = i8;
102 #[doc(include = "schar.md")]
103 #[stable(feature = "raw_os", since = "1.1.0")]
104 pub type c_schar = i8;
105 #[doc(include = "uchar.md")]
106 #[stable(feature = "raw_os", since = "1.1.0")]
107 pub type c_uchar = u8;
108 #[doc(include = "short.md")]
109 #[stable(feature = "raw_os", since = "1.1.0")]
110 pub type c_short = i16;
111 #[doc(include = "ushort.md")]
112 #[stable(feature = "raw_os", since = "1.1.0")]
113 pub type c_ushort = u16;
114 #[doc(include = "int.md")]
115 #[stable(feature = "raw_os", since = "1.1.0")]
116 pub type c_int = i32;
117 #[doc(include = "uint.md")]
118 #[stable(feature = "raw_os", since = "1.1.0")]
119 pub type c_uint = u32;
120 #[doc(include = "long.md")]
121 #[cfg(any(target_pointer_width = "32", windows))]
122 #[stable(feature = "raw_os", since = "1.1.0")]
123 pub type c_long = i32;
124 #[doc(include = "ulong.md")]
125 #[cfg(any(target_pointer_width = "32", windows))]
126 #[stable(feature = "raw_os", since = "1.1.0")]
127 pub type c_ulong = u32;
128 #[doc(include = "long.md")]
129 #[cfg(all(target_pointer_width = "64", not(windows)))]
130 #[stable(feature = "raw_os", since = "1.1.0")]
131 pub type c_long = i64;
132 #[doc(include = "ulong.md")]
133 #[cfg(all(target_pointer_width = "64", not(windows)))]
134 #[stable(feature = "raw_os", since = "1.1.0")]
135 pub type c_ulong = u64;
136 #[doc(include = "longlong.md")]
137 #[stable(feature = "raw_os", since = "1.1.0")]
138 pub type c_longlong = i64;
139 #[doc(include = "ulonglong.md")]
140 #[stable(feature = "raw_os", since = "1.1.0")]
141 pub type c_ulonglong = u64;
142 #[doc(include = "float.md")]
143 #[stable(feature = "raw_os", since = "1.1.0")]
144 pub type c_float = f32;
145 #[doc(include = "double.md")]
146 #[stable(feature = "raw_os", since = "1.1.0")]
147 pub type c_double = f64;
149 #[stable(feature = "raw_os", since = "1.1.0")]
151 pub use core::ffi::c_void;