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:
parent
a66f7a7a53
commit
197bd2e10c
3 changed files with 5 additions and 1 deletions
|
@ -18,6 +18,7 @@ use pretty_bytes::converter::convert;
|
||||||
use term_grid::{Cell, Direction, Filling, Grid, GridOptions};
|
use term_grid::{Cell, Direction, Filling, Grid, GridOptions};
|
||||||
use time::{strftime, Timespec};
|
use time::{strftime, Timespec};
|
||||||
|
|
||||||
|
#[cfg(unix)]
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate lazy_static;
|
extern crate lazy_static;
|
||||||
|
|
||||||
|
@ -587,11 +588,13 @@ fn color_name(name: String, typ: &str) -> String {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(unix)]
|
||||||
macro_rules! has {
|
macro_rules! has {
|
||||||
($mode:expr, $perm:expr) => (
|
($mode:expr, $perm:expr) => (
|
||||||
$mode & ($perm as mode_t) != 0
|
$mode & ($perm as mode_t) != 0
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
fn display_file_name(
|
fn display_file_name(
|
||||||
path: &Path,
|
path: &Path,
|
||||||
|
@ -698,4 +701,3 @@ fn display_symlink_count(metadata: &Metadata) -> String {
|
||||||
fn display_symlink_count(metadata: &Metadata) -> String {
|
fn display_symlink_count(metadata: &Metadata) -> String {
|
||||||
metadata.nlink().to_string()
|
metadata.nlink().to_string()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ use std::io::Result as IOResult;
|
||||||
use std::path::{Component, Path, PathBuf};
|
use std::path::{Component, Path, PathBuf};
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
|
|
||||||
|
#[cfg(unix)]
|
||||||
macro_rules! has {
|
macro_rules! has {
|
||||||
($mode:expr, $perm:expr) => (
|
($mode:expr, $perm:expr) => (
|
||||||
$mode & ($perm as u32) != 0
|
$mode & ($perm as u32) != 0
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
mod common;
|
mod common;
|
||||||
|
|
||||||
|
#[cfg(unix)]
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate lazy_static;
|
extern crate lazy_static;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue