Skip to content

Commit 6029717

Browse files
dybucctgross35
authored andcommitted
linux(uclibc): move definition of time_t
A recent patch [1] overhauled the `uclibc` module to add support for "toggling" 64-bit `time_t`. That patch, though, was centered around supported 32-bit arm targets. This patch extends that to all platforms whose target environment matches `uclibc`. This option is mahine word-independent. [1]: 2549bd4
1 parent 5614859 commit 6029717

5 files changed

Lines changed: 11 additions & 17 deletions

File tree

src/unix/linux_like/linux/uclibc/arm/mod.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,6 @@ use crate::prelude::*;
33

44
pub type wchar_t = c_uint;
55

6-
cfg_if! {
7-
// Set cfg(libc_unstable_uclibc_time64) in rustflags if your uclibc has 64-bit time
8-
if #[cfg(linux_time_bits64)] {
9-
pub type time_t = c_longlong;
10-
pub type suseconds_t = c_longlong;
11-
} else {
12-
pub type time_t = c_long;
13-
pub type suseconds_t = c_long;
14-
}
15-
}
16-
176
pub type clock_t = c_long;
187
pub type fsblkcnt_t = c_ulong;
198
pub type fsfilcnt_t = c_ulong;

src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ use crate::off64_t;
22
use crate::prelude::*;
33

44
pub type clock_t = i32;
5-
pub type time_t = i32;
6-
pub type suseconds_t = i32;
75
pub type wchar_t = i32;
86
pub type off_t = i32;
97
pub type ino_t = u32;

src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ pub type fsfilcnt_t = c_ulong;
88
pub type ino_t = u64;
99
pub type nlink_t = u64;
1010
pub type off_t = i64;
11-
pub type suseconds_t = i64;
12-
pub type time_t = i64;
1311
pub type wchar_t = i32;
1412

1513
s! {

src/unix/linux_like/linux/uclibc/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ pub type rlim_t = c_ulong;
1212
pub type __rlimit_resource_t = c_ulong;
1313
pub type __priority_which_t = c_uint;
1414

15+
cfg_if! {
16+
// Set `--cfg=libc_unstable_uclibc_time64` in RUSTFLAGS if your uClibc has 64-bit `time_t`.
17+
if #[cfg(linux_time_bits64)] {
18+
pub type time_t = i64;
19+
pub type suseconds_t = i64;
20+
} else {
21+
pub type time_t = c_long;
22+
pub type suseconds_t = c_long;
23+
}
24+
}
25+
1526
cfg_if! {
1627
if #[cfg(doc)] {
1728
// Used in `linux::arch` to define ioctl constants.

src/unix/linux_like/linux/uclibc/x86_64/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ pub type nlink_t = c_uint;
1414
pub type off_t = c_long;
1515
// [uClibc docs] Note stat64 has the same shape as stat for x86-64.
1616
pub type stat64 = stat;
17-
pub type suseconds_t = c_long;
18-
pub type time_t = c_int;
1917
pub type wchar_t = c_int;
2018
pub type pthread_t = c_ulong;
2119

0 commit comments

Comments
 (0)