diff --git a/dns_sd_avahi.c b/dns_sd_avahi.c index 36ad221f4..c9d2e24e4 100644 --- a/dns_sd_avahi.c +++ b/dns_sd_avahi.c @@ -21,14 +21,20 @@ * * */ +#include "debug.h" #include "iio-private.h" #include "network.h" #include "iio-lock.h" #include - #include -#include "debug.h" + +#include +#include +#include +#include +#include +#include /* * Fundamentally, this builds up a linked list to manage diff --git a/network.h b/network.h index 19197f3c4..416738d54 100644 --- a/network.h +++ b/network.h @@ -51,33 +51,25 @@ #endif /* _WIN32 */ #ifdef HAVE_DNS_SD -#ifdef HAVE_AVAHI -#include -#include -#include -#include -#include -#include -#define DNS_SD_ADDRESS_STR_MAX AVAHI_ADDRESS_STR_MAX -#else /* !HAVE_AVAHI */ + #define DNS_SD_ADDRESS_STR_MAX (40) /* IPv6 Max = 4*8 + 7 + 1 for NUL */ -#endif /* HAVE_AVAHI */ /* MacOS doesn't include ENOMEDIUM (No medium found) like Linux does */ #ifndef ENOMEDIUM #define ENOMEDIUM ENOENT #endif +struct AvahiSimplePoll; +struct AvahiAddress; + /* Common structure which all dns_sd_[*] files fill out * Anything that is dynamically allocated (malloc) needs to be managed */ struct dns_sd_discovery_data { struct iio_mutex *lock; -#ifdef HAVE_AVAHI - AvahiSimplePoll *poll; - AvahiAddress *address; + struct AvahiSimplePoll *poll; + struct AvahiAddress *address; uint16_t found, resolved; -#endif /* HAVE_AVAHI */ char addr_str[DNS_SD_ADDRESS_STR_MAX]; char *hostname; uint16_t port;