fix/du ~ update to correct WinAPI usage (fixes #1496)

This commit is contained in:
Roy Ivy III 2020-05-26 12:32:57 -05:00
parent 403a6a3935
commit 251905da3d
2 changed files with 8 additions and 9 deletions

View file

@ -22,8 +22,7 @@ uucore = { version="0.0.3", package="uucore", git="https://github.com/uutils/uuc
uucore_procs = { version="0.0.3", package="uucore_procs", git="https://github.com/uutils/uucore.git", branch="canary" }
[target.'cfg(target_os = "windows")'.dependencies]
kernel32-sys = "0.2"
winapi = { version = "0.3", features = ["handleapi", "winerror"] }
winapi = { version = "0.3", features = ["errhandlingapi", "fileapi", "handleapi", "winerror"] }
[[bin]]
name = "df"

View file

@ -13,16 +13,16 @@ extern crate number_prefix;
#[macro_use]
extern crate uucore;
#[cfg(windows)]
extern crate kernel32;
use clap::{App, Arg};
#[cfg(windows)]
extern crate winapi;
use clap::{App, Arg};
#[cfg(windows)]
use kernel32::{
FindFirstVolumeW, FindNextVolumeW, FindVolumeClose, GetDriveTypeW, GetLastError,
GetVolumeInformationW, GetVolumePathNamesForVolumeNameW, QueryDosDeviceW,
use winapi::um::errhandlingapi::GetLastError;
#[cfg(windows)]
use winapi::um::fileapi::{
FindFirstVolumeW, FindNextVolumeW, FindVolumeClose, GetDriveTypeW, GetVolumeInformationW,
GetVolumePathNamesForVolumeNameW, QueryDosDeviceW,
};
use number_prefix::{binary_prefix, decimal_prefix, PrefixNames, Prefixed, Standalone};