Skip to content

Commit 59b3bbd

Browse files
authored
Auto merge of #432 - raphlinus:fuchsia, r=alexcrichton
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.
2 parents 4260022 + 6d24c4b commit 59b3bbd

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/unix/mod.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ cfg_if! {
228228
#[link(name = "root")]
229229
#[link(name = "network")]
230230
extern {}
231+
} else if #[cfg(target_os = "fuchsia")] {
232+
#[link(name = "c")]
233+
#[link(name = "mxio")]
234+
extern {}
231235
} else {
232236
#[link(name = "c")]
233237
#[link(name = "m")]
@@ -843,7 +847,8 @@ extern {
843847
cfg_if! {
844848
if #[cfg(any(target_os = "linux",
845849
target_os = "android",
846-
target_os = "emscripten"))] {
850+
target_os = "emscripten",
851+
target_os = "fuchsia"))] {
847852
mod notbsd;
848853
pub use self::notbsd::*;
849854
} else if #[cfg(any(target_os = "macos",

src/unix/notbsd/linux/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,7 @@ extern {
728728

729729
cfg_if! {
730730
if #[cfg(any(target_env = "musl",
731+
target_os = "fuchsia",
731732
target_os = "emscripten"))] {
732733
mod musl;
733734
pub use self::musl::*;

src/unix/notbsd/mod.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ s! {
5353
pub ai_protocol: ::c_int,
5454
pub ai_addrlen: socklen_t,
5555

56-
#[cfg(any(target_os = "linux", target_os = "emscripten"))]
56+
#[cfg(any(target_os = "linux",
57+
target_os = "emscripten",
58+
target_os = "fuchsia"))]
5759
pub ai_addr: *mut ::sockaddr,
5860

5961
pub ai_canonname: *mut c_char,
@@ -858,7 +860,8 @@ extern {
858860

859861
cfg_if! {
860862
if #[cfg(any(target_os = "linux",
861-
target_os = "emscripten"))] {
863+
target_os = "emscripten",
864+
target_os = "fuchsia"))] {
862865
mod linux;
863866
pub use self::linux::*;
864867
} else if #[cfg(target_os = "android")] {

0 commit comments

Comments
 (0)