1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 11:07:44 +00:00

fix: gate unix-only macros (silences "unused" warnings)

This commit is contained in:
Roy Ivy III 2018-09-03 17:45:58 -05:00
parent a66f7a7a53
commit 197bd2e10c
3 changed files with 5 additions and 1 deletions

View file

@ -18,6 +18,7 @@ use pretty_bytes::converter::convert;
use term_grid::{Cell, Direction, Filling, Grid, GridOptions};
use time::{strftime, Timespec};
#[cfg(unix)]
#[macro_use]
extern crate lazy_static;
@ -587,11 +588,13 @@ fn color_name(name: String, typ: &str) -> String {
}
}
#[cfg(unix)]
macro_rules! has {
($mode:expr, $perm:expr) => (
$mode & ($perm as mode_t) != 0
)
}
#[cfg(unix)]
fn display_file_name(
path: &Path,
@ -698,4 +701,3 @@ fn display_symlink_count(metadata: &Metadata) -> String {
fn display_symlink_count(metadata: &Metadata) -> String {
metadata.nlink().to_string()
}

View file

@ -25,6 +25,7 @@ use std::io::Result as IOResult;
use std::path::{Component, Path, PathBuf};
use std::borrow::Cow;
#[cfg(unix)]
macro_rules! has {
($mode:expr, $perm:expr) => (
$mode & ($perm as u32) != 0

View file

@ -1,6 +1,7 @@
#[macro_use]
mod common;
#[cfg(unix)]
#[macro_use]
extern crate lazy_static;