Don't use libc with wasm32-unknown-unknown (#27)
This commit is contained in:
parent
3eba48bc15
commit
eaec085662
|
@ -8,11 +8,13 @@ description = "Fixed-size hashes"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
heapsize = { version = "0.4", optional = true }
|
heapsize = { version = "0.4", optional = true }
|
||||||
libc = { version = "0.2", optional = true, default-features = false }
|
|
||||||
rand = { version = "0.4", optional = true }
|
rand = { version = "0.4", optional = true }
|
||||||
rustc-hex = { version = "1.0", optional = true }
|
rustc-hex = { version = "1.0", optional = true }
|
||||||
quickcheck = { version = "0.6", 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]
|
[features]
|
||||||
default = ["libc"]
|
default = ["libc"]
|
||||||
std = ["rustc-hex", "rand"]
|
std = ["rustc-hex", "rand"]
|
||||||
|
|
|
@ -418,7 +418,7 @@ macro_rules! impl_std_for_hash_internals {
|
||||||
($from: ident, $size: tt) => {}
|
($from: ident, $size: tt) => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature="libc")]
|
#[cfg(all(feature="libc", not(target_os = "unknown")))]
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
macro_rules! impl_heapsize_for_hash {
|
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]
|
#[macro_export]
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
macro_rules! impl_libc_for_hash {
|
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]
|
#[macro_export]
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
macro_rules! impl_libc_for_hash {
|
macro_rules! impl_libc_for_hash {
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
#![cfg_attr(not(feature = "std"), no_std)]
|
#![cfg_attr(not(feature = "std"), no_std)]
|
||||||
|
|
||||||
#[cfg(feature="libc")]
|
#[cfg(all(feature="libc", not(target_os = "unknown")))]
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub extern crate libc;
|
pub extern crate libc;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue