Commit 06fe30e2 authored by Richard Backhouse's avatar Richard Backhouse

zeroconf/ZeroconfBonjour: Fix compile errors resulting from "refactor to…

zeroconf/ZeroconfBonjour: Fix compile errors resulting from "refactor to SocketEvent" and reenable bonjour for darwin build
parent 08e76815
...@@ -39,9 +39,9 @@ class BonjourMonitor final { ...@@ -39,9 +39,9 @@ class BonjourMonitor final {
public: public:
BonjourMonitor(EventLoop &_loop, DNSServiceRef _service_ref) BonjourMonitor(EventLoop &_loop, DNSServiceRef _service_ref)
:service_ref(_service_ref), :service_ref(_service_ref),
socket_event(SocketDescriptor(DNSServiceRefSockFD(service_ref)), socket_event(_loop,
BIND_THIS_METHOD(OnSocketReady), BIND_THIS_METHOD(OnSocketReady),
_loop) SocketDescriptor(DNSServiceRefSockFD(service_ref)))
{ {
socket_event.ScheduleRead(); socket_event.ScheduleRead();
} }
...@@ -50,9 +50,13 @@ public: ...@@ -50,9 +50,13 @@ public:
DNSServiceRefDeallocate(service_ref); DNSServiceRefDeallocate(service_ref);
} }
void Cancel() noexcept {
socket_event.Cancel();
}
protected: protected:
/* virtual methods from class SocketMonitor */ /* virtual methods from class SocketMonitor */
void OnSocketReady([[maybe_unused]] unsigned flags) noexcept override { void OnSocketReady([[maybe_unused]] unsigned flags) noexcept {
DNSServiceProcessResult(service_ref); DNSServiceProcessResult(service_ref);
} }
}; };
......
...@@ -4,9 +4,7 @@ libavahi_client_dep = dependency('', required: false) ...@@ -4,9 +4,7 @@ libavahi_client_dep = dependency('', required: false)
if zeroconf_option == 'auto' if zeroconf_option == 'auto'
if is_darwin if is_darwin
# Bonjour disabled for now because its build is broken zeroconf_option = 'bonjour'
#zeroconf_option = 'bonjour'
zeroconf_option = 'disabled'
elif is_android or is_windows elif is_android or is_windows
zeroconf_option = 'disabled' zeroconf_option = 'disabled'
elif dbus_dep.found() elif dbus_dep.found()
...@@ -31,10 +29,12 @@ if zeroconf_option == 'bonjour' ...@@ -31,10 +29,12 @@ if zeroconf_option == 'bonjour'
error('dns_sd.h not found') error('dns_sd.h not found')
endif endif
if is_darwin bonjour_deps = [
bonjour_dep = declare_dependency(link_args: ['-framework', 'dnssd']) log_dep,
else ]
bonjour_dep = declare_dependency(link_args: ['-ldns_sd'])
if not is_darwin
bonjour_deps += declare_dependency(link_args: ['-ldns_sd'])
endif endif
conf.set('HAVE_BONJOUR', true) conf.set('HAVE_BONJOUR', true)
...@@ -47,10 +47,7 @@ if zeroconf_option == 'bonjour' ...@@ -47,10 +47,7 @@ if zeroconf_option == 'bonjour'
zeroconf_dep = declare_dependency( zeroconf_dep = declare_dependency(
link_with: zeroconf, link_with: zeroconf,
dependencies: [ dependencies: bonjour_deps,
bonjour_dep,
log_dep,
],
) )
else else
if not libavahi_client_dep.found() if not libavahi_client_dep.found()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment