From: Ondřej Surý Date: Mon, 3 Jun 2019 12:13:23 +0000 (+0200) Subject: Make detect GNU rather than Linux X-Git-Tag: v9.15.1~17^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2e54b1be2901c5b687169ad4d6f0f9017ae9493d;p=thirdparty%2Fbind9.git Make detect GNU rather than Linux Instead of only supporting Linux, try making support other GNU platforms as well. Since some compilers define __GNUC__ on BSDs (e.g. Clang on FreeBSD), move the relevant section to the bottom of the platform-specific part of , so that it only gets evaluated when more specific platform determination criteria are not met. Also include so that any byte-swapping macros which may be defined in that file on older platforms are used in the fallback definitions of the nonstandard hto[bl]e{16,32,64}() and [bl]e{16,32,64}toh() conversion functions. --- diff --git a/lib/isc/include/isc/endian.h b/lib/isc/include/isc/endian.h index 98a26dafac1..30a8f1e0760 100644 --- a/lib/isc/include/isc/endian.h +++ b/lib/isc/include/isc/endian.h @@ -11,11 +11,7 @@ #pragma once -#if defined(__linux__) || defined(__CYGWIN__) - -#include - -#elif defined __APPLE__ +#if defined __APPLE__ #include @@ -96,6 +92,12 @@ # define bswap_32(x) BSWAP_32(x) # define bswap_64(x) BSWAP_64(x) +#elif defined(__ANDROID__) || defined(__CYGWIN__) || \ + defined(__GNUC__) || defined(__GNU__) + +# include +# include + #else #endif /* Specific platform support */