Don't use libc with wasm32-unknown-unknown (#27)

This commit is contained in:
Pierre Krieger 2018-03-15 09:41:01 +01:00 committed by Tomasz Drwięga
parent 3eba48bc15
commit eaec085662
3 changed files with 7 additions and 5 deletions

View File

@ -8,11 +8,13 @@ description = "Fixed-size hashes"
[dependencies]
heapsize = { version = "0.4", optional = true }
libc = { version = "0.2", optional = true, default-features = false }
rand = { version = "0.4", optional = true }
rustc-hex = { version = "1.0", optional = true }
quickcheck = { version = "0.6", optional = true }
[target.'cfg(not(target_os = "unknown"))'.dependencies]
libc = { version = "0.2", optional = true, default-features = false }
[features]
default = ["libc"]
std = ["rustc-hex", "rand"]

View File

@ -418,7 +418,7 @@ macro_rules! impl_std_for_hash_internals {
($from: ident, $size: tt) => {}
}
#[cfg(feature="libc")]
#[cfg(all(feature="libc", not(target_os = "unknown")))]
#[macro_export]
#[doc(hidden)]
macro_rules! impl_heapsize_for_hash {
@ -431,7 +431,7 @@ macro_rules! impl_heapsize_for_hash {
}
}
#[cfg(feature="libc")]
#[cfg(all(feature="libc", not(target_os = "unknown")))]
#[macro_export]
#[doc(hidden)]
macro_rules! impl_libc_for_hash {
@ -453,7 +453,7 @@ macro_rules! impl_libc_for_hash {
}
}
#[cfg(not(feature="libc"))]
#[cfg(any(not(feature="libc"), target_os = "unknown"))]
#[macro_export]
#[doc(hidden)]
macro_rules! impl_libc_for_hash {

View File

@ -8,7 +8,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(feature="libc")]
#[cfg(all(feature="libc", not(target_os = "unknown")))]
#[doc(hidden)]
pub extern crate libc;