melib/datetime: add cfg for musl builds
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>pull/354/head
parent
1fe3619208
commit
8de8addd11
|
@ -90,25 +90,23 @@ extern "C" {
|
||||||
fn gettimeofday(tv: *mut libc::timeval, tz: *mut libc::timezone) -> i32;
|
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)]
|
#[repr(i32)]
|
||||||
#[derive(Clone, Copy)]
|
#[derive(Clone, Copy)]
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
enum LocaleCategoryMask {
|
enum LocaleCategoryMask {
|
||||||
Time = libc::LC_TIME_MASK,
|
Time = libc::LC_TIME_MASK,
|
||||||
All = libc::LC_ALL_MASK,
|
All = PLATFORM_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,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[repr(i32)]
|
#[repr(i32)]
|
||||||
|
|
Loading…
Reference in New Issue