Skip to content

Commit

Permalink
Auto merge of #432 - raphlinus:fuchsia, r=alexcrichton
Browse files Browse the repository at this point in the history
Add support for Fuchsia

These patches add support for the Fuchsia operating system. For the
time being, it shares a lot of infrastructure with the Linux target,
because of the use of a musl-based libc.
  • Loading branch information
bors authored Oct 20, 2016
2 parents 4260022 + 6d24c4b commit 59b3bbd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ cfg_if! {
#[link(name = "root")]
#[link(name = "network")]
extern {}
} else if #[cfg(target_os = "fuchsia")] {
#[link(name = "c")]
#[link(name = "mxio")]
extern {}
} else {
#[link(name = "c")]
#[link(name = "m")]
Expand Down Expand Up @@ -843,7 +847,8 @@ extern {
cfg_if! {
if #[cfg(any(target_os = "linux",
target_os = "android",
target_os = "emscripten"))] {
target_os = "emscripten",
target_os = "fuchsia"))] {
mod notbsd;
pub use self::notbsd::*;
} else if #[cfg(any(target_os = "macos",
Expand Down
1 change: 1 addition & 0 deletions src/unix/notbsd/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@ extern {

cfg_if! {
if #[cfg(any(target_env = "musl",
target_os = "fuchsia",
target_os = "emscripten"))] {
mod musl;
pub use self::musl::*;
Expand Down
7 changes: 5 additions & 2 deletions src/unix/notbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ s! {
pub ai_protocol: ::c_int,
pub ai_addrlen: socklen_t,

#[cfg(any(target_os = "linux", target_os = "emscripten"))]
#[cfg(any(target_os = "linux",
target_os = "emscripten",
target_os = "fuchsia"))]
pub ai_addr: *mut ::sockaddr,

pub ai_canonname: *mut c_char,
Expand Down Expand Up @@ -858,7 +860,8 @@ extern {

cfg_if! {
if #[cfg(any(target_os = "linux",
target_os = "emscripten"))] {
target_os = "emscripten",
target_os = "fuchsia"))] {
mod linux;
pub use self::linux::*;
} else if #[cfg(target_os = "android")] {
Expand Down

0 comments on commit 59b3bbd

Please sign in to comment.