Skip to content

Commit

Permalink
Merge pull request #4199 from taiki-e/c-char
Browse files Browse the repository at this point in the history
Fix c_char on various targets
  • Loading branch information
tgross35 authored Dec 17, 2024
2 parents 5f0d017 + 0344a78 commit bd30d1e
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 10 deletions.
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;

0 comments on commit bd30d1e

Please sign in to comment.