melib/datetime: add missing LC libc constants for openbsd target_os

Fixes #242

"Compilation failure on master on OpenBSD" #242
pull/246/head
Manos Pitsidianakis 2023-07-03 11:21:20 +03:00
parent 957abf4e72
commit 7998e1e77e
Signed by: Manos Pitsidianakis
GPG Key ID: 7729C7707F7E09D0
2 changed files with 14 additions and 3 deletions

View File

@ -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)]

View File

@ -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;