From c7d1d8041c8468c770a875a3c6f67354053b91e0 Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Thu, 25 Jan 2024 11:18:20 +0100 Subject: [PATCH] utilities: Avoid inclusion of network headers No-OS applications most likely don't have . This header was included from dns_sd.h, which was included in utilities.c. utilities.c only needed dns_sd.h for the FQDN_LEN macro; so move this macro to network.h instead, which does not include any non-standard headers. Signed-off-by: Paul Cercueil --- dns_sd.h | 1 - network.h | 2 ++ utilities.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dns_sd.h b/dns_sd.h index c7a5f1314..039e7a199 100644 --- a/dns_sd.h +++ b/dns_sd.h @@ -24,7 +24,6 @@ /* IPv6 Max = 4*8 + 7 + 1 for '%' + interface length */ #define DNS_SD_ADDRESS_STR_MAX (40 + IF_NAMESIZE) -#define FQDN_LEN (255) /* RFC 1035 */ /* MacOS doesn't include ENOMEDIUM (No medium found) like Linux does */ #ifndef ENOMEDIUM diff --git a/network.h b/network.h index f1d11250a..db73d50a5 100644 --- a/network.h +++ b/network.h @@ -12,6 +12,8 @@ #include +#define FQDN_LEN (255) /* RFC 1035 */ + struct iio_context_params; struct iio_context_pdata; struct addrinfo; diff --git a/utilities.c b/utilities.c index 3ae7b76a0..040798d1c 100644 --- a/utilities.c +++ b/utilities.c @@ -9,9 +9,9 @@ /* Force the XSI version of strerror_r */ #undef _GNU_SOURCE -#include "dns_sd.h" #include "iio-config.h" #include "iio-private.h" +#include "network.h" // for FQDN_LEN #include #include