From 448a802911948ec367d984214a56292d02803a06 Mon Sep 17 00:00:00 2001 From: NatalyaKovalova Date: Wed, 6 Sep 2017 19:36:28 +0300 Subject: [PATCH] Add iOS support --- src/lib.rs | 4 ++-- src/platform/mod.rs | 4 ++-- src/platform/test.rs | 10 +++++----- src/test.rs | 10 +++++----- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 8b0e002e9..4ba40a951 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,7 +7,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![cfg_attr(any(feature = "force-inprocess", target_os = "windows", target_os = "android"), +#![cfg_attr(any(feature = "force-inprocess", target_os = "windows", target_os = "android", target_os = "ios"), feature(mpsc_select))] #![cfg_attr(all(feature = "unstable", test), feature(specialization))] @@ -18,7 +18,7 @@ extern crate bincode; extern crate libc; extern crate rand; extern crate serde; -#[cfg(any(feature = "force-inprocess", target_os = "windows", target_os = "android"))] +#[cfg(any(feature = "force-inprocess", target_os = "windows", target_os = "android", target_os = "ios"))] extern crate uuid; #[cfg(all(not(feature = "force-inprocess"), any(target_os = "linux", target_os = "freebsd")))] diff --git a/src/platform/mod.rs b/src/platform/mod.rs index 3500fe01d..0282c3c54 100644 --- a/src/platform/mod.rs +++ b/src/platform/mod.rs @@ -43,9 +43,9 @@ mod os { pub use super::macos::*; } -#[cfg(any(feature = "force-inprocess", target_os = "windows", target_os = "android"))] +#[cfg(any(feature = "force-inprocess", target_os = "windows", target_os = "android", target_os = "ios"))] mod inprocess; -#[cfg(any(feature = "force-inprocess", target_os = "windows", target_os = "android"))] +#[cfg(any(feature = "force-inprocess", target_os = "windows", target_os = "android", target_os = "ios"))] mod os { pub use super::inprocess::*; } diff --git a/src/platform/test.rs b/src/platform/test.rs index eb50515b8..e91d98cde 100644 --- a/src/platform/test.rs +++ b/src/platform/test.rs @@ -15,9 +15,9 @@ use std::time::{Duration, Instant}; use std::thread; use platform::{OsIpcSender, OsIpcOneShotServer}; -#[cfg(not(any(feature = "force-inprocess", target_os = "windows", target_os = "android")))] +#[cfg(not(any(feature = "force-inprocess", target_os = "windows", target_os = "android", target_os = "ios")))] use libc::{kill, SIGSTOP, SIGCONT}; -#[cfg(not(any(feature = "force-inprocess", target_os = "windows", target_os = "android")))] +#[cfg(not(any(feature = "force-inprocess", target_os = "windows", target_os = "android", target_os = "ios")))] use test::{fork, Wait}; #[test] @@ -396,7 +396,7 @@ fn receiver_set() { } #[test] -#[cfg(not(any(feature = "force-inprocess", target_os = "windows", target_os = "android")))] +#[cfg(not(any(feature = "force-inprocess", target_os = "windows", target_os = "android", target_os = "ios")))] fn receiver_set_eintr() { let (server, name) = OsIpcOneShotServer::new().unwrap(); let child_pid = unsafe { @@ -644,7 +644,7 @@ fn server_connect_first() { (data, vec![], vec![])); } -#[cfg(not(any(feature = "force-inprocess", target_os = "windows", target_os = "android")))] +#[cfg(not(any(feature = "force-inprocess", target_os = "windows", target_os = "android", target_os = "ios")))] #[test] fn cross_process() { let (server, name) = OsIpcOneShotServer::new().unwrap(); @@ -662,7 +662,7 @@ fn cross_process() { (data, vec![], vec![])); } -#[cfg(not(any(feature = "force-inprocess", target_os = "windows", target_os = "android")))] +#[cfg(not(any(feature = "force-inprocess", target_os = "windows", target_os = "android", target_os = "ios")))] #[test] fn cross_process_sender_transfer() { let (server, name) = OsIpcOneShotServer::new().unwrap(); diff --git a/src/test.rs b/src/test.rs index 00984b379..b18bd3a77 100644 --- a/src/test.rs +++ b/src/test.rs @@ -8,7 +8,7 @@ // except according to those terms. use ipc::{self, IpcReceiverSet, IpcSender, IpcSharedMemory}; -#[cfg(not(any(feature = "force-inprocess", target_os = "windows", target_os = "android")))] +#[cfg(not(any(feature = "force-inprocess", target_os = "windows", target_os = "android", target_os = "ios")))] use ipc::IpcReceiver; use router::ROUTER; use libc; @@ -20,13 +20,13 @@ use std::sync::Arc; use std::sync::mpsc::{self, Sender}; use std::thread; -#[cfg(not(any(feature = "force-inprocess", target_os = "windows", target_os = "android")))] +#[cfg(not(any(feature = "force-inprocess", target_os = "windows", target_os = "android", target_os = "ios")))] use ipc::IpcOneShotServer; -#[cfg(not(any(feature = "force-inprocess", target_os = "windows", target_os = "android")))] +#[cfg(not(any(feature = "force-inprocess", target_os = "windows", target_os = "android", target_os = "ios")))] use std::io::Error; -#[cfg(not(any(feature = "force-inprocess", target_os = "windows", target_os = "android")))] +#[cfg(not(any(feature = "force-inprocess", target_os = "windows", target_os = "android", target_os = "ios")))] // I'm not actually sure invoking this is indeed unsafe -- but better safe than sorry... pub unsafe fn fork(child_func: F) -> libc::pid_t { match libc::fork() { @@ -135,7 +135,7 @@ fn select() { } } -#[cfg(not(any(feature = "force-inprocess", target_os = "windows", target_os = "android")))] +#[cfg(not(any(feature = "force-inprocess", target_os = "windows", target_os = "android", target_os = "ios")))] #[test] fn cross_process_embedded_senders() { let person = ("Patrick Walton".to_owned(), 29);