Skip to content

Commit bdfd015

Browse files
committed
unix: riscv32: Move type defines inside confif
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
1 parent c6c9181 commit bdfd015

File tree

2 files changed

+27
-25
lines changed

2 files changed

+27
-25
lines changed

src/unix/linux_like/linux/gnu/b32/mod.rs

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,39 @@ use pthread_mutex_t;
55
pub type c_long = i32;
66
pub type c_ulong = u32;
77
pub type clock_t = i32;
8-
pub type time_t = i32;
9-
pub type suseconds_t = i32;
10-
pub type ino_t = u32;
11-
pub type off_t = i32;
12-
pub type blkcnt_t = i32;
13-
14-
pub type fsblkcnt_t = ::c_ulong;
15-
pub type fsfilcnt_t = ::c_ulong;
16-
pub type rlim_t = c_ulong;
8+
179
pub type shmatt_t = ::c_ulong;
1810
pub type msgqnum_t = ::c_ulong;
1911
pub type msglen_t = ::c_ulong;
20-
pub type blksize_t = i32;
2112
pub type nlink_t = u32;
2213
pub type __u64 = ::c_ulonglong;
2314
pub type __fsword_t = i32;
15+
pub type fsblkcnt64_t = u64;
16+
pub type fsfilcnt64_t = u64;
17+
18+
cfg_if! {
19+
if #[cfg(target_arch = "riscv32")] {
20+
pub type time_t = i64;
21+
pub type suseconds_t = i64;
22+
pub type ino_t = u64;
23+
pub type off_t = i64;
24+
pub type blkcnt_t = i64;
25+
pub type fsblkcnt_t = u64;
26+
pub type fsfilcnt_t = u64;
27+
pub type rlim_t = u64;
28+
pub type blksize_t = i64;
29+
} else {
30+
pub type time_t = i32;
31+
pub type suseconds_t = i32;
32+
pub type ino_t = u32;
33+
pub type off_t = i32;
34+
pub type blkcnt_t = i32;
35+
pub type fsblkcnt_t = ::c_ulong;
36+
pub type fsfilcnt_t = ::c_ulong;
37+
pub type rlim_t = c_ulong;
38+
pub type blksize_t = i32;
39+
}
40+
}
2441

2542
s! {
2643
pub struct stat {

src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,8 @@
11
//! RISC-V-specific definitions for 32-bit linux-like values
22
33
pub type c_char = u8;
4-
pub type c_ulong = u32;
54
pub type wchar_t = ::c_int;
65

7-
pub type nlink_t = ::c_uint;
8-
pub type fsblkcnt64_t = u64;
9-
pub type fsfilcnt64_t = u64;
10-
pub type suseconds_t = i64;
11-
pub type time_t = i64;
12-
pub type fsfilcnt_t = u64;
13-
pub type fsblkcnt_t = u64;
14-
pub type blksize_t = i64;
15-
pub type blkcnt_t = i64;
16-
pub type rlim_t = u64;
17-
pub type off_t = i64;
18-
pub type ino_t = u64;
19-
pub type __u64 = ::c_ulonglong;
20-
216
s! {
227
pub struct pthread_attr_t {
238
__size: [::c_ulong; 7],

0 commit comments

Comments
 (0)