From eb4ce618e2f1e55b245ae64de0890b3cada2eb7a Mon Sep 17 00:00:00 2001 From: Anhad Singh Date: Tue, 9 Dec 2025 01:13:22 +1100 Subject: [PATCH] fix(header/time): define `TIME_UTC` Workaround for a bug inside `cbindgen`. For some reason it does not like us exporting constants that depend on other constants that are *not* defined as a part of the same module. --- src/header/time/constants.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/header/time/constants.rs b/src/header/time/constants.rs index 34f0056573..5c610ac230 100644 --- a/src/header/time/constants.rs +++ b/src/header/time/constants.rs @@ -1,7 +1,5 @@ use crate::platform::types::*; -pub use self::sys::*; - #[cfg(target_os = "linux")] #[path = "linux.rs"] pub mod sys; @@ -10,6 +8,8 @@ pub mod sys; #[path = "redox.rs"] pub mod sys; +pub use self::sys::*; + pub(crate) const UTC: *const c_char = b"UTC\0".as_ptr().cast(); pub(crate) const DAY_NAMES: [&str; 7] = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; @@ -28,6 +28,6 @@ pub const TIMER_ABSTIME: c_int = 1; // The values are offset by one for simplicity since zero represents an error. /// `TIME_UTC` returns the time since the Unix epoch. -pub const TIME_UTC: c_int = sys::CLOCK_REALTIME + 1; +pub const TIME_UTC: c_int = CLOCK_REALTIME + 1; /// `TIME_MONOTONIC` returns the time from the monotonically increasing clock. -pub const TIME_MONOTONIC: c_int = sys::CLOCK_MONOTONIC + 1; +pub const TIME_MONOTONIC: c_int = CLOCK_MONOTONIC + 1;