threadshare: Fix missing Darwin platform compatibility

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2515>
This commit is contained in:
L. E. Segovia 2025-08-28 20:47:25 -03:00
parent 8ba691f085
commit 611bb49b40

View file

@ -21,10 +21,15 @@ pub mod imp {
IP_MULTICAST_IF,
};
#[cfg(target_os = "macos")]
#[cfg(any(target_os = "macos", target_os = "ios"))]
use libc::ip_mreq;
#[cfg(any(target_os = "solaris", target_os = "illumos", target_os = "macos"))]
#[cfg(any(
target_os = "solaris",
target_os = "illumos",
target_os = "macos",
target_os = "ios"
))]
use std::net::Ipv4Addr;
/// Join multicast address for a given interface.
@ -53,7 +58,12 @@ pub mod imp {
) -> Result<(), io::Error> {
let index = iface.index.unwrap_or(0);
#[cfg(not(any(target_os = "solaris", target_os = "illumos", target_os = "macos")))]
#[cfg(not(any(
target_os = "solaris",
target_os = "illumos",
target_os = "macos",
target_os = "ios"
)))]
{
let group_op: i32 = if join {
IP_ADD_MEMBERSHIP
@ -201,7 +211,7 @@ pub mod imp {
Ok(())
}
#[cfg(target_os = "macos")]
#[cfg(any(target_os = "macos", target_os = "ios"))]
{
use getifaddrs::Address;