Merge pull request #107 from brson/emscripten

Add emscripten support
This commit is contained in:
Alex Crichton 2015-12-21 17:19:30 -08:00
commit fb83189000
3 changed files with 11 additions and 4 deletions

View File

@ -124,6 +124,9 @@ cfg_if! {
} else if #[cfg(target_env = "musl")] {
#[link(name = "c", kind = "static")]
extern {}
} else if #[cfg(target_os = "emscripten")] {
#[link(name = "c")]
extern {}
} else if #[cfg(any(target_os = "macos",
target_os = "ios",
target_os = "android",
@ -664,7 +667,9 @@ extern {
}
cfg_if! {
if #[cfg(any(target_os = "linux", target_os = "android"))] {
if #[cfg(any(target_os = "linux",
target_os = "android",
target_os = "emscripten"))] {
mod notbsd;
pub use self::notbsd::*;
} else if #[cfg(any(target_os = "macos",

View File

@ -511,7 +511,8 @@ extern {
}
cfg_if! {
if #[cfg(target_env = "musl")] {
if #[cfg(any(target_env = "musl",
target_os = "emscripten"))] {
mod musl;
pub use self::musl::*;
} else if #[cfg(any(target_arch = "mips", target_arch = "mipsel"))] {

View File

@ -50,7 +50,7 @@ s! {
pub ai_protocol: ::c_int,
pub ai_addrlen: socklen_t,
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "emscripten"))]
pub ai_addr: *mut ::sockaddr,
pub ai_canonname: *mut c_char,
@ -610,7 +610,8 @@ extern {
}
cfg_if! {
if #[cfg(target_os = "linux")] {
if #[cfg(any(target_os = "linux",
target_os = "emscripten"))] {
mod linux;
pub use self::linux::*;
} else if #[cfg(target_os = "android")] {