melib/datetime: add missing LC libc constants for openbsd target_os
Fixes #242 "Compilation failure on master on OpenBSD" #242pull/246/head
parent
957abf4e72
commit
7998e1e77e
|
@ -90,6 +90,7 @@ extern "C" {
|
|||
fn gettimeofday(tv: *mut libc::timeval, tz: *mut libc::timezone) -> i32;
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "openbsd"))]
|
||||
#[repr(i32)]
|
||||
#[derive(Copy, Clone)]
|
||||
#[allow(dead_code)]
|
||||
|
@ -98,6 +99,18 @@ enum LocaleCategoryMask {
|
|||
All = libc::LC_ALL_MASK,
|
||||
}
|
||||
|
||||
#[cfg(target_os = "openbsd")]
|
||||
const _LC_LAST: c_int = 7;
|
||||
|
||||
#[cfg(target_os = "openbsd")]
|
||||
#[repr(i32)]
|
||||
#[derive(Copy, Clone)]
|
||||
#[allow(dead_code)]
|
||||
enum LocaleCategoryMask {
|
||||
Time = 1 << libc::LC_TIME,
|
||||
All = (1 << _LC_LAST) - 2,
|
||||
}
|
||||
|
||||
#[repr(i32)]
|
||||
#[derive(Copy, Clone)]
|
||||
#[allow(dead_code)]
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
|
||||
//! A `ShellExpandTrait` to expand paths like a shell.
|
||||
|
||||
#[cfg(not(any(target_os = "netbsd", target_os = "macos")))]
|
||||
use std::os::unix::io::AsRawFd;
|
||||
use std::{
|
||||
ffi::OsStr,
|
||||
os::unix::ffi::OsStrExt,
|
||||
|
@ -71,7 +69,7 @@ impl ShellExpandTrait for Path {
|
|||
|
||||
#[cfg(target_os = "linux")]
|
||||
fn complete(&self, force: bool) -> SmallVec<[String; 128]> {
|
||||
use std::convert::TryFrom;
|
||||
use std::{convert::TryFrom, os::unix::io::AsRawFd};
|
||||
|
||||
use libc::dirent64;
|
||||
use nix::fcntl::OFlag;
|
||||
|
|
Loading…
Reference in New Issue