Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add emscripten support #107

Merged
merged 2 commits into from
Dec 22, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/unix/notbsd/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))] {
Expand Down
5 changes: 3 additions & 2 deletions src/unix/notbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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")] {
Expand Down