melib/datetime: add cfg for musl builds

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
pull/354/head
Manos Pitsidianakis 2024-02-06 16:22:44 +02:00
parent 1fe3619208
commit 8de8addd11
Signed by: Manos Pitsidianakis
GPG Key ID: 7729C7707F7E09D0
1 changed files with 12 additions and 14 deletions

View File

@ -90,25 +90,23 @@ extern "C" {
fn gettimeofday(tv: *mut libc::timeval, tz: *mut libc::timezone) -> i32;
}
#[cfg(not(target_os = "openbsd"))]
#[cfg(target_os = "openbsd")]
const _LC_LAST: c_int = 7;
#[cfg(all(target_os = "openbsd", target_env = "musl"))]
const PLATFORM_ALL_MASK: i32 = 0x7fffffff;
#[cfg(all(target_os = "openbsd", not(target_env = "musl")))]
const PLATFORM_ALL_MASK: i32 = (1 << _LC_LAST) - 2;
#[cfg(all(not(target_os = "openbsd"), target_env = "musl"))]
const PLATFORM_ALL_MASK: i32 = 0x7fffffff;
#[cfg(all(not(target_os = "openbsd"), not(target_env = "musl")))]
const PLATFORM_ALL_MASK: i32 = libc::LC_ALL_MASK;
#[repr(i32)]
#[derive(Clone, Copy)]
#[allow(dead_code)]
enum LocaleCategoryMask {
Time = libc::LC_TIME_MASK,
All = libc::LC_ALL_MASK,
}
#[cfg(target_os = "openbsd")]
const _LC_LAST: c_int = 7;
#[cfg(target_os = "openbsd")]
#[repr(i32)]
#[derive(Clone, Copy)]
#[allow(dead_code)]
enum LocaleCategoryMask {
Time = 1 << libc::LC_TIME,
All = (1 << _LC_LAST) - 2,
All = PLATFORM_ALL_MASK,
}
#[repr(i32)]