threadshare: Fix build on non-Solaris/Darwin UNIXes

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2523>
This commit is contained in:
Sebastian Dröge 2025-08-29 09:33:27 +03:00 committed by GStreamer Marge Bot
parent 16230c7b3a
commit 418405bd4d

View file

@ -68,7 +68,11 @@ use getifaddrs::Interface;
pub mod imp {
use super::*;
use std::{io, mem, net::UdpSocket, os::unix::io::AsRawFd};
use std::{
io, mem,
net::{Ipv4Addr, UdpSocket},
os::unix::io::AsRawFd,
};
use libc::{
in_addr, ip_mreqn, setsockopt, IPPROTO_IP, IP_ADD_MEMBERSHIP, IP_DROP_MEMBERSHIP,
@ -78,14 +82,6 @@ pub mod imp {
#[cfg(any(target_os = "macos", target_os = "ios"))]
use libc::ip_mreq;
#[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.
pub fn join_multicast_v4(
socket: &UdpSocket,