unix: riscv32: Move type defines inside confif

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
Alistair Francis 2020-10-01 07:15:39 -07:00
parent c6c9181874
commit bdfd01599e
2 changed files with 26 additions and 24 deletions

View File

@ -5,22 +5,39 @@ use pthread_mutex_t;
pub type c_long = i32;
pub type c_ulong = u32;
pub type clock_t = i32;
pub type time_t = i32;
pub type suseconds_t = i32;
pub type ino_t = u32;
pub type off_t = i32;
pub type blkcnt_t = i32;
pub type fsblkcnt_t = ::c_ulong;
pub type fsfilcnt_t = ::c_ulong;
pub type rlim_t = c_ulong;
pub type shmatt_t = ::c_ulong;
pub type msgqnum_t = ::c_ulong;
pub type msglen_t = ::c_ulong;
pub type blksize_t = i32;
pub type nlink_t = u32;
pub type __u64 = ::c_ulonglong;
pub type __fsword_t = i32;
pub type fsblkcnt64_t = u64;
pub type fsfilcnt64_t = u64;
cfg_if! {
if #[cfg(target_arch = "riscv32")] {
pub type time_t = i64;
pub type suseconds_t = i64;
pub type ino_t = u64;
pub type off_t = i64;
pub type blkcnt_t = i64;
pub type fsblkcnt_t = u64;
pub type fsfilcnt_t = u64;
pub type rlim_t = u64;
pub type blksize_t = i64;
} else {
pub type time_t = i32;
pub type suseconds_t = i32;
pub type ino_t = u32;
pub type off_t = i32;
pub type blkcnt_t = i32;
pub type fsblkcnt_t = ::c_ulong;
pub type fsfilcnt_t = ::c_ulong;
pub type rlim_t = c_ulong;
pub type blksize_t = i32;
}
}
s! {
pub struct stat {

View File

@ -1,23 +1,8 @@
//! RISC-V-specific definitions for 32-bit linux-like values
pub type c_char = u8;
pub type c_ulong = u32;
pub type wchar_t = ::c_int;
pub type nlink_t = ::c_uint;
pub type fsblkcnt64_t = u64;
pub type fsfilcnt64_t = u64;
pub type suseconds_t = i64;
pub type time_t = i64;
pub type fsfilcnt_t = u64;
pub type fsblkcnt_t = u64;
pub type blksize_t = i64;
pub type blkcnt_t = i64;
pub type rlim_t = u64;
pub type off_t = i64;
pub type ino_t = u64;
pub type __u64 = ::c_ulonglong;
s! {
pub struct pthread_attr_t {
__size: [::c_ulong; 7],