Update winapi version from 0.2 to 0.3 (#202)

Adds only the necessary cargo features to reduce compile time and reduce
the chance of linking errors occurring for unused libraries (e.g.
d3d12.dll fails to link on my win10 VM).

I thought I'd try and land this before before working on the wasapi
backend implementation for #201.

Tested both beep.rs and enumerate.rs and they work fine with the update.
This commit is contained in:
mitchmindtree 2018-02-08 03:36:59 +11:00 • committed by Pierre Krieger
parent 3ff9e6fe65
commit b47e46a4ac
5 changed files with 158 additions and 122 deletions

View file

@ -1,18 +1,17 @@
extern crate winapi;
extern crate ole32;
extern crate kernel32;
use std::io::Error as IoError;
pub use self::endpoint::{Endpoint, EndpointsIterator, SupportedFormatsIterator, default_endpoint};
pub use self::voice::{Buffer, EventLoop, VoiceId};
use self::winapi::um::winnt::HRESULT;
mod com;
mod endpoint;
mod voice;
#[inline]
fn check_result(result: winapi::HRESULT) -> Result<(), IoError> {
fn check_result(result: HRESULT) -> Result<(), IoError> {
if result < 0 {
Err(IoError::from_raw_os_error(result))
} else {