Skip to content

Commit 6077237

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 + 7ac91c6 commit 6077237

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
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

+6-5
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ 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 = "android",
58+
target_os = "emscripten",
59+
target_os = "fuchsia"))]
5760
pub ai_addr: *mut ::sockaddr,
5861

5962
pub ai_canonname: *mut c_char,
6063

61-
#[cfg(target_os = "android")]
62-
pub ai_addr: *mut ::sockaddr,
63-
6464
pub ai_next: *mut addrinfo,
6565
}
6666

@@ -858,7 +858,8 @@ extern {
858858

859859
cfg_if! {
860860
if #[cfg(any(target_os = "linux",
861-
target_os = "emscripten"))] {
861+
target_os = "emscripten",
862+
target_os = "fuchsia"))] {
862863
mod linux;
863864
pub use self::linux::*;
864865
} else if #[cfg(target_os = "android")] {

0 commit comments

Comments
 (0)