Skip to content

Commit 216e5a8

Browse files
author
Julian Orth
committed
Fix c_char on ARM
c_char is u8 on ARM [breaking-change]
1 parent 96c8f2b commit 216e5a8

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

src/liblibc/lib.rs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,9 @@ pub mod types {
512512
target_arch = "mips",
513513
target_arch = "mipsel"))]
514514
pub mod arch {
515+
#[cfg(any(target_arch = "x86",
516+
target_arch = "mips",
517+
target_arch = "mipsel"))]
515518
pub mod c95 {
516519
pub type c_char = i8;
517520
pub type c_schar = i8;
@@ -531,6 +534,26 @@ pub mod types {
531534
pub type suseconds_t = i32;
532535
pub type wchar_t = i32;
533536
}
537+
#[cfg(target_arch = "arm")]
538+
pub mod c95 {
539+
pub type c_char = u8;
540+
pub type c_schar = i8;
541+
pub type c_uchar = u8;
542+
pub type c_short = i16;
543+
pub type c_ushort = u16;
544+
pub type c_int = i32;
545+
pub type c_uint = u32;
546+
pub type c_long = i32;
547+
pub type c_ulong = u32;
548+
pub type c_float = f32;
549+
pub type c_double = f64;
550+
pub type size_t = u32;
551+
pub type ptrdiff_t = i32;
552+
pub type clock_t = i32;
553+
pub type time_t = i32;
554+
pub type suseconds_t = i32;
555+
pub type wchar_t = i32;
556+
}
534557
pub mod c99 {
535558
pub type c_longlong = i64;
536559
pub type c_ulonglong = u64;
@@ -1805,6 +1828,7 @@ pub mod types {
18051828

18061829
#[cfg(any(target_arch = "arm", target_arch = "x86"))]
18071830
pub mod arch {
1831+
#[cfg(target_arch = "x86")]
18081832
pub mod c95 {
18091833
pub type c_char = i8;
18101834
pub type c_schar = i8;
@@ -1824,6 +1848,26 @@ pub mod types {
18241848
pub type suseconds_t = i32;
18251849
pub type wchar_t = i32;
18261850
}
1851+
#[cfg(target_arch = "arm")]
1852+
pub mod c95 {
1853+
pub type c_char = u8;
1854+
pub type c_schar = i8;
1855+
pub type c_uchar = u8;
1856+
pub type c_short = i16;
1857+
pub type c_ushort = u16;
1858+
pub type c_int = i32;
1859+
pub type c_uint = u32;
1860+
pub type c_long = i32;
1861+
pub type c_ulong = u32;
1862+
pub type c_float = f32;
1863+
pub type c_double = f64;
1864+
pub type size_t = u32;
1865+
pub type ptrdiff_t = i32;
1866+
pub type clock_t = u32;
1867+
pub type time_t = i32;
1868+
pub type suseconds_t = i32;
1869+
pub type wchar_t = i32;
1870+
}
18271871
pub mod c99 {
18281872
pub type c_longlong = i64;
18291873
pub type c_ulonglong = u64;

0 commit comments

Comments
 (0)