Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix c_char on various targets #4199

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/solid/aarch64.rs
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion src/solid/arm.rs
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion src/unix/linux_like/android/b64/riscv64/mod.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/uclibc/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/unix/newlib/vita/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 11 additions & 1 deletion src/unix/nuttx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 7 additions & 1 deletion src/unix/redox/mod.rs
Original file line number Diff line number Diff line change
@@ -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! {
Expand Down
8 changes: 7 additions & 1 deletion src/unix/solarish/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/vxworks/riscv32.rs
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion src/vxworks/riscv64.rs
Original file line number Diff line number Diff line change
@@ -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;
Loading