Skip to content

Commit 01e7dfd

Browse files
committed
fix(Windows): fixes a failing windows build
1 parent 0d541a2 commit 01e7dfd

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/fmt.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,16 @@ use ansi_term::ANSIString;
88
#[cfg(feature = "color")]
99
use libc;
1010

11-
#[cfg(feature = "color")]
11+
#[cfg(all(feature = "color", not(target_os = "windows")))]
1212
const STDERR: i32 = libc::STDERR_FILENO;
13-
#[cfg(feature = "color")]
13+
#[cfg(all(feature = "color", not(target_os = "windows")))]
1414
const STDOUT: i32 = libc::STDOUT_FILENO;
1515

16+
#[cfg(any(not(feature = "color"), target_os = "windows"))]
17+
const STDERR: i32 = 0;
18+
#[cfg(any(not(feature = "color"), target_os = "windows"))]
19+
const STDOUT: i32 = 0;
20+
1621
#[doc(hidden)]
1722
#[derive(Debug, Copy, Clone, PartialEq)]
1823
pub enum ColorWhen {

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ extern crate strsim;
407407
extern crate ansi_term;
408408
#[cfg(feature = "yaml")]
409409
extern crate yaml_rust;
410-
#[cfg(all(feature = "wrap_help", not(target_os = "windows")))]
410+
#[cfg(any(feature = "wrap_help", feature = "color"))]
411411
extern crate libc;
412412
#[cfg(all(feature = "wrap_help", not(target_os = "windows")))]
413413
extern crate unicode_width;

0 commit comments

Comments
 (0)