Skip to content

Commit 015ab65

Browse files
committed
just use libc::clockid_t
1 parent 5008a31 commit 015ab65

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

library/std/src/sys/unix/time.rs

+3-8
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,9 @@ mod inner {
290290
impl Instant {
291291
pub fn now() -> Instant {
292292
#[cfg(target_os = "macos")]
293-
const clock_id: clock_t = libc::CLOCK_UPTIME_RAW;
293+
const clock_id: libc::clockid_t = libc::CLOCK_UPTIME_RAW;
294294
#[cfg(not(target_os = "macos"))]
295-
const clock_id: clock_t = libc::CLOCK_MONOTONIC;
295+
const clock_id: libc::clockid_t = libc::CLOCK_MONOTONIC;
296296
Instant { t: Timespec::now(clock_id) }
297297
}
298298

@@ -324,13 +324,8 @@ mod inner {
324324
}
325325
}
326326

327-
#[cfg(not(any(target_os = "dragonfly", target_os = "espidf", target_os = "horizon")))]
328-
pub type clock_t = libc::c_int;
329-
#[cfg(any(target_os = "dragonfly", target_os = "espidf", target_os = "horizon"))]
330-
pub type clock_t = libc::c_ulong;
331-
332327
impl Timespec {
333-
pub fn now(clock: clock_t) -> Timespec {
328+
pub fn now(clock: libc::clockid_t) -> Timespec {
334329
// Try to use 64-bit time in preparation for Y2038.
335330
#[cfg(all(target_os = "linux", target_env = "gnu", target_pointer_width = "32"))]
336331
{

0 commit comments

Comments
 (0)