Skip to content

Commit 69a6b25

Browse files
authored
Build for iOS (#183)
1 parent 30378e2 commit 69a6b25

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/adapters/tcp.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::net::{SocketAddr};
1515
#[cfg(unix)]
1616
use std::ffi::{CString};
1717
use std::io::{self, ErrorKind, Read, Write};
18-
#[cfg(target_os = "macos")]
18+
#[cfg(any(target_os = "macos", target_os = "ios"))]
1919
use std::num::NonZeroU32;
2020
use std::mem::{forget, MaybeUninit};
2121
use std::os::raw::c_int;
@@ -127,10 +127,10 @@ impl Remote for RemoteResource {
127127
if let Some(bind_device) = config.bind_device {
128128
let device = CString::new(bind_device)?;
129129

130-
#[cfg(not(target_os = "macos"))]
130+
#[cfg(all(not(target_os = "macos"), not(target_os = "ios")))]
131131
socket.bind_device(Some(device.as_bytes()))?;
132132

133-
#[cfg(target_os = "macos")]
133+
#[cfg(any(target_os = "macos", target_os = "ios"))]
134134
match NonZeroU32::new(unsafe { libc::if_nametoindex(device.as_ptr()) }) {
135135
Some(index) => socket.bind_device_by_index_v4(Some(index))?,
136136
None => {
@@ -283,10 +283,10 @@ impl Local for LocalResource {
283283
if let Some(bind_device) = config.bind_device {
284284
let device = CString::new(bind_device)?;
285285

286-
#[cfg(not(target_os = "macos"))]
286+
#[cfg(all(not(target_os = "macos"), not(target_os = "ios")))]
287287
socket.bind_device(Some(device.as_bytes()))?;
288288

289-
#[cfg(target_os = "macos")]
289+
#[cfg(any(target_os = "macos", target_os = "ios"))]
290290
match NonZeroU32::new(unsafe { libc::if_nametoindex(device.as_ptr()) }) {
291291
Some(index) => socket.bind_device_by_index_v4(Some(index))?,
292292
None => {

0 commit comments

Comments
 (0)