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.
This commit is contained in:
Anhad Singh
2025-12-09 01:13:22 +11:00
parent ff7ab99baf
commit eb4ce618e2
+4 -4
View File
@@ -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;