Skip to content

Commit

Permalink
fix: support win x86
Browse files Browse the repository at this point in the history
  • Loading branch information
ArcticLampyrid committed Jul 3, 2024
1 parent ce64b0a commit 4451359
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions zeroconf/src/bonjour/browser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl fmt::Debug for BonjourBrowserContext {
}
}

unsafe extern "C" fn browse_callback(
unsafe extern "system" fn browse_callback(
_sd_ref: DNSServiceRef,
_flags: DNSServiceFlags,
interface_index: u32,
Expand Down Expand Up @@ -160,7 +160,7 @@ unsafe fn handle_browse(
)
}

unsafe extern "C" fn resolve_callback(
unsafe extern "system" fn resolve_callback(
_sd_ref: DNSServiceRef,
_flags: DNSServiceFlags,
interface_index: u32,
Expand Down Expand Up @@ -224,7 +224,7 @@ unsafe fn handle_resolve(
)
}

unsafe extern "C" fn get_address_info_callback(
unsafe extern "system" fn get_address_info_callback(
_sd_ref: DNSServiceRef,
_flags: DNSServiceFlags,
_interface_index: u32,
Expand Down
2 changes: 1 addition & 1 deletion zeroconf/src/bonjour/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl BonjourServiceContext {
}
}

unsafe extern "C" fn register_callback(
unsafe extern "system" fn register_callback(
_sd_ref: DNSServiceRef,
_flags: DNSServiceFlags,
error: DNSServiceErrorType,
Expand Down
4 changes: 2 additions & 2 deletions zeroconf/src/bonjour/service_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use crate::{bonjour::bonjour_util, Result};
use bonjour_sys::{
DNSServiceBrowse, DNSServiceBrowseReply, DNSServiceFlags, DNSServiceGetAddrInfo,
dnssd_sock_t, DNSServiceBrowse, DNSServiceBrowseReply, DNSServiceFlags, DNSServiceGetAddrInfo,
DNSServiceGetAddrInfoReply, DNSServiceProcessResult, DNSServiceProtocol, DNSServiceRef,
DNSServiceRefDeallocate, DNSServiceRefSockFD, DNSServiceRegister, DNSServiceRegisterReply,
DNSServiceResolve, DNSServiceResolveReply,
Expand Down Expand Up @@ -186,7 +186,7 @@ impl ManagedDNSServiceRef {
///
/// [`DNSServiceRefSockFD`]: https://developer.apple.com/documentation/dnssd/1804698-dnsservicerefsockfd?language=objc
#[cfg(target_vendor = "pc")]
pub fn sock_fd(&self) -> u64 {
pub fn sock_fd(&self) -> dnssd_sock_t {
unsafe { DNSServiceRefSockFD(self.0) }
}
}
Expand Down
4 changes: 2 additions & 2 deletions zeroconf/src/ffi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pub(crate) mod bonjour {
#[cfg(target_vendor = "pc")]
pub(crate) mod bonjour {
use crate::Result;
use bonjour_sys::{fd_set, select, timeval};
use bonjour_sys::{dnssd_sock_t, fd_set, select, timeval};
#[cfg(target_vendor = "apple")]
use std::mem;
use std::ptr;
Expand All @@ -115,7 +115,7 @@ pub(crate) mod bonjour {
///
/// # Safety
/// This function is unsafe because it directly interfaces with C-library system calls.
pub unsafe fn read_select(sock_fd: u64, timeout: Duration) -> Result<u32> {
pub unsafe fn read_select(sock_fd: dnssd_sock_t, timeout: Duration) -> Result<u32> {
if timeout.as_secs() > i32::MAX as u64 {
return Err(
"Invalid timeout duration, as_secs() value exceeds ::libc::c_long. ".into(),
Expand Down

0 comments on commit 4451359

Please sign in to comment.