Skip to content

Commit

Permalink
Fix c_char on various targets
Browse files Browse the repository at this point in the history
- aarch64-kmc-solid_asp3
- armv7a-kmc-solid_asp3-eabi
- armv7a-kmc-solid_asp3-eabihf
- riscv64-linux-android
- x86_64-unknown-l4re-uclibc
- armv7-sony-vita-newlibeabihf
- riscv32imac-unknown-nuttx-elf
- riscv32imafc-unknown-nuttx-elf
- riscv32imc-unknown-nuttx-elf
- riscv64gc-unknown-nuttx-elf
- riscv64imac-unknown-nuttx-elf
- thumbv6m-nuttx-eabi
- thumbv7em-nuttx-eabi
- thumbv7em-nuttx-eabihf
- thumbv7m-nuttx-eabi
- thumbv8m.base-nuttx-eabi
- thumbv8m.main-nuttx-eabi
- thumbv8m.main-nuttx-eabihf
- aarch64-unknown-redox
- aarch64-unknown-illumos
- riscv32-wrs-vxworks
- riscv64-wrs-vxworks
  • Loading branch information
taiki-e committed Dec 17, 2024
1 parent 39a6799 commit 0344a78
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 0344a78

Please sign in to comment.