diff --git a/src/solid/aarch64.rs b/src/solid/aarch64.rs index ceabea397b80..4032488b6c0d 100644 --- a/src/solid/aarch64.rs +++ b/src/solid/aarch64.rs @@ -1,4 +1,4 @@ -pub type c_char = i8; +pub type c_char = u8; pub type wchar_t = u32; pub type c_long = i64; pub type c_ulong = u64; diff --git a/src/solid/arm.rs b/src/solid/arm.rs index 04cc1542deae..55240068aa08 100644 --- a/src/solid/arm.rs +++ b/src/solid/arm.rs @@ -1,4 +1,4 @@ -pub type c_char = i8; +pub type c_char = u8; pub type wchar_t = u32; pub type c_long = i32; pub type c_ulong = u32; diff --git a/src/unix/linux_like/android/b64/riscv64/mod.rs b/src/unix/linux_like/android/b64/riscv64/mod.rs index f214fe33702a..d35c40895510 100644 --- a/src/unix/linux_like/android/b64/riscv64/mod.rs +++ b/src/unix/linux_like/android/b64/riscv64/mod.rs @@ -1,7 +1,7 @@ use crate::off64_t; use crate::prelude::*; -pub type c_char = i8; +pub type c_char = u8; pub type wchar_t = u32; pub type greg_t = i64; pub type __u64 = c_ulonglong; diff --git a/src/unix/linux_like/linux/uclibc/x86_64/mod.rs b/src/unix/linux_like/linux/uclibc/x86_64/mod.rs index 07574581d77c..b41936f94fee 100644 --- a/src/unix/linux_like/linux/uclibc/x86_64/mod.rs +++ b/src/unix/linux_like/linux/uclibc/x86_64/mod.rs @@ -6,7 +6,7 @@ use crate::prelude::*; pub type blkcnt_t = i64; pub type blksize_t = i64; pub type clock_t = i64; -pub type c_char = u8; +pub type c_char = i8; pub type c_long = i64; pub type c_ulong = u64; pub type fsblkcnt_t = c_ulong; diff --git a/src/unix/newlib/vita/mod.rs b/src/unix/newlib/vita/mod.rs index 120c4d54972f..1a8c89319fa2 100644 --- a/src/unix/newlib/vita/mod.rs +++ b/src/unix/newlib/vita/mod.rs @@ -3,7 +3,7 @@ use crate::prelude::*; pub type clock_t = c_long; -pub type c_char = i8; +pub type c_char = u8; pub type wchar_t = u32; pub type c_long = i32; diff --git a/src/unix/nuttx/mod.rs b/src/unix/nuttx/mod.rs index 95d1156bfc48..78ecf3f13350 100644 --- a/src/unix/nuttx/mod.rs +++ b/src/unix/nuttx/mod.rs @@ -5,7 +5,17 @@ pub type nlink_t = u16; pub type ino_t = u16; pub type blkcnt_t = u64; pub type blksize_t = i16; -pub type c_char = i8; +cfg_if! { + if #[cfg(any( + target_arch = "arm", + target_arch = "riscv32", + target_arch = "riscv64", + ))] { + pub type c_char = u8; + } else { + pub type c_char = i8; + } +} pub type c_long = isize; pub type c_ulong = usize; pub type cc_t = u8; diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs index db854dd6300e..1c8bb40e746f 100644 --- a/src/unix/redox/mod.rs +++ b/src/unix/redox/mod.rs @@ -1,6 +1,12 @@ use crate::prelude::*; -pub type c_char = i8; +cfg_if! { + if #[cfg(target_arch = "aarch64")] { + pub type c_char = u8; + } else { + pub type c_char = i8; + } +} pub type wchar_t = i32; cfg_if! { diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs index 9fce13226afc..83d94bff8437 100644 --- a/src/unix/solarish/mod.rs +++ b/src/unix/solarish/mod.rs @@ -2,7 +2,13 @@ use core::mem::size_of; use crate::prelude::*; -pub type c_char = i8; +cfg_if! { + if #[cfg(target_arch = "aarch64")] { + pub type c_char = u8; + } else { + pub type c_char = i8; + } +} pub type c_long = i64; pub type c_ulong = u64; pub type caddr_t = *mut c_char; diff --git a/src/vxworks/riscv32.rs b/src/vxworks/riscv32.rs index e617bb83c6ce..40a8e338e83a 100644 --- a/src/vxworks/riscv32.rs +++ b/src/vxworks/riscv32.rs @@ -1,4 +1,4 @@ -pub type c_char = i8; +pub type c_char = u8; pub type wchar_t = i32; pub type c_long = i32; pub type c_ulong = u32; diff --git a/src/vxworks/riscv64.rs b/src/vxworks/riscv64.rs index 5e95ea2567dd..ccd68b0c64f8 100644 --- a/src/vxworks/riscv64.rs +++ b/src/vxworks/riscv64.rs @@ -1,4 +1,4 @@ -pub type c_char = i8; +pub type c_char = u8; pub type wchar_t = i32; pub type c_long = i64; pub type c_ulong = u64;