@@ -4,6 +4,45 @@ use core::fmt;
4
4
pub type c_int = i32 ;
5
5
pub type c_uchar = u8 ;
6
6
pub type c_uint = u32 ;
7
+
8
+ /// This is an exact copy of https://doc.rust-lang.org/src/std/os/raw/mod.rs.html
9
+ /// `c_char` might be either signed or unsigned, defined by the platform,
10
+ /// This should match the right type using conditional compilations from stdlib.
11
+ #[ cfg( any( all( target_os = "linux" , any( target_arch = "aarch64" ,
12
+ target_arch = "arm" ,
13
+ target_arch = "powerpc" ,
14
+ target_arch = "powerpc64" ,
15
+ target_arch = "s390x" ) ) ,
16
+ all( target_os = "android" , any( target_arch = "aarch64" ,
17
+ target_arch = "arm" ) ) ,
18
+ all( target_os = "l4re" , target_arch = "x86_64" ) ,
19
+ all( target_os = "freebsd" , any( target_arch = "aarch64" ,
20
+ target_arch = "arm" ,
21
+ target_arch = "powerpc" ,
22
+ target_arch = "powerpc64" ) ) ,
23
+ all( target_os = "netbsd" , any( target_arch = "aarch64" ,
24
+ target_arch = "arm" ,
25
+ target_arch = "powerpc" ) ) ,
26
+ all( target_os = "openbsd" , target_arch = "aarch64" ) ,
27
+ all( target_os = "fuchsia" , target_arch = "aarch64" ) ) ) ]
28
+ pub type c_char = u8 ;
29
+ #[ cfg( not( any( all( target_os = "linux" , any( target_arch = "aarch64" ,
30
+ target_arch = "arm" ,
31
+ target_arch = "powerpc" ,
32
+ target_arch = "powerpc64" ,
33
+ target_arch = "s390x" ) ) ,
34
+ all( target_os = "android" , any( target_arch = "aarch64" ,
35
+ target_arch = "arm" ) ) ,
36
+ all( target_os = "l4re" , target_arch = "x86_64" ) ,
37
+ all( target_os = "freebsd" , any( target_arch = "aarch64" ,
38
+ target_arch = "arm" ,
39
+ target_arch = "powerpc" ,
40
+ target_arch = "powerpc64" ) ) ,
41
+ all( target_os = "netbsd" , any( target_arch = "aarch64" ,
42
+ target_arch = "arm" ,
43
+ target_arch = "powerpc" ) ) ,
44
+ all( target_os = "openbsd" , target_arch = "aarch64" ) ,
45
+ all( target_os = "fuchsia" , target_arch = "aarch64" ) ) ) ) ]
7
46
pub type c_char = i8 ;
8
47
9
48
/// This is an exact copy of https://doc.rust-lang.org/core/ffi/enum.c_void.html
0 commit comments