From 67af72308768165d055665e80ebec3604cc28460 Mon Sep 17 00:00:00 2001 From: Mary Strodl Date: Thu, 11 Mar 2021 20:13:27 -0500 Subject: [PATCH] Fix switch compilation --- lib/dnsc/dns.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/dnsc/dns.c b/lib/dnsc/dns.c index bc95522b6..39f0c6ee2 100644 --- a/lib/dnsc/dns.c +++ b/lib/dnsc/dns.c @@ -70,7 +70,9 @@ #include /* FD_SETSIZE socklen_t */ #include /* FD_ZERO FD_SET fd_set select(2) */ #include /* AF_INET AF_INET6 AF_UNIX struct sockaddr struct sockaddr_in struct sockaddr_in6 socket(2) */ -#if defined(AF_UNIX) +#ifdef __SWITCH__ +#include +#elif defined(AF_UNIX) #include /* struct sockaddr_un */ #endif #include /* F_SETFD F_GETFL F_SETFL O_NONBLOCK fcntl(2) */ @@ -851,7 +853,7 @@ DNS_NOTUSED static size_t dns_strnlcpy(char *dst, size_t lim, const char *src, s } /* dns_strnlcpy() */ -#if (defined AF_UNIX && !defined _WIN32) +#if (defined AF_UNIX && !defined _WIN32 && !defined(__SWITCH__)) #define DNS_HAVE_SOCKADDR_UN 1 #else #define DNS_HAVE_SOCKADDR_UN 0 @@ -9322,7 +9324,7 @@ enum dns_rcode dns_ircode(const char *name) { #include #endif -#if !_WIN32 +#if !_WIN32 && !defined(__SWITCH__) #include #endif @@ -9389,7 +9391,7 @@ DNS_NORETURN static void panic(const char *fmt, ...) { vfprintf(stderr, fmt, ap); exit(EXIT_FAILURE); -#else +#elif !defined(__SWITCH__) verrx(EXIT_FAILURE, fmt, ap); #endif } /* panic() */