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

Merge pull request #737 from jbcrail/more-windows-fixes

Fix build errors on Windows.
This commit is contained in:
Heather 2015-12-01 11:16:05 +04:00
commit c0251d8f19
9 changed files with 15 additions and 8 deletions

View file

@ -6,6 +6,7 @@ build = "build.rs"
[features] [features]
unix = [ unix = [
"chmod",
"chroot", "chroot",
"du", "du",
"groups", "groups",
@ -31,7 +32,6 @@ generic = [
"base64", "base64",
"basename", "basename",
"cat", "cat",
"chmod",
"cksum", "cksum",
"comm", "comm",
"cp", "cp",

View file

@ -28,7 +28,6 @@ PROGS := \
base64 \ base64 \
basename \ basename \
cat \ cat \
chmod \
cksum \ cksum \
comm \ comm \
cp \ cp \
@ -81,6 +80,7 @@ PROGS := \
whoami whoami
UNIX_PROGS := \ UNIX_PROGS := \
chmod \
chroot \ chroot \
du \ du \
groups \ groups \

View file

@ -14,6 +14,7 @@ uucore = { path="../uucore" }
[dev-dependencies] [dev-dependencies]
time = "*" time = "*"
[[bin]] [[bin]]
name="mv" name="mv"
path="mv.rs" path="mv.rs"

View file

@ -10,6 +10,8 @@ path = "sync.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
winapi = "*"
kernel32-sys = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]

View file

@ -6,6 +6,7 @@ authors = []
[dependencies] [dependencies]
libc = "*" libc = "*"
time = "*" time = "*"
winapi = "*"
[lib] [lib]
path = "lib.rs" path = "lib.rs"

View file

@ -12,7 +12,8 @@
// be backported to stable (<= 1.1). This will likely be dropped // be backported to stable (<= 1.1). This will likely be dropped
// when the path trait stabilizes. // when the path trait stabilizes.
use ::libc; #[cfg(unix)]
use super::libc;
use std::env; use std::env;
use std::fs; use std::fs;
use std::io::{Error, ErrorKind, Result}; use std::io::{Error, ErrorKind, Result};
@ -151,7 +152,7 @@ pub fn is_stdin_interactive() -> bool {
#[cfg(windows)] #[cfg(windows)]
pub fn is_stdin_interactive() -> bool { pub fn is_stdin_interactive() -> bool {
0 false
} }
#[cfg(unix)] #[cfg(unix)]
@ -161,7 +162,7 @@ pub fn is_stdout_interactive() -> bool {
#[cfg(windows)] #[cfg(windows)]
pub fn is_stdout_interactive() -> bool { pub fn is_stdout_interactive() -> bool {
0 false
} }
#[cfg(unix)] #[cfg(unix)]
@ -171,5 +172,5 @@ pub fn is_stderr_interactive() -> bool {
#[cfg(windows)] #[cfg(windows)]
pub fn is_stderr_interactive() -> bool { pub fn is_stderr_interactive() -> bool {
0 false
} }

View file

@ -1,5 +1,6 @@
extern crate libc; extern crate libc;
extern crate time; extern crate time;
#[cfg(windows)] extern crate winapi;
#[macro_use] #[macro_use]
mod macros; mod macros;

View file

@ -10,6 +10,8 @@ path = "whoami.rs"
[dependencies] [dependencies]
getopts = "*" getopts = "*"
libc = "*" libc = "*"
winapi = "*"
advapi32-sys = "*"
uucore = { path="../uucore" } uucore = { path="../uucore" }
[[bin]] [[bin]]

View file

@ -11,8 +11,7 @@ extern crate winapi;
extern crate advapi32; extern crate advapi32;
extern crate uucore; extern crate uucore;
use std::ffi::OsString; use std::io::{Error, Result};
use std::io::{Error, Result, Write};
use std::mem; use std::mem;
use std::os::windows::ffi::OsStringExt; use std::os::windows::ffi::OsStringExt;
use uucore::wide::FromWide; use uucore::wide::FromWide;