Instead of only supporting Linux, try making <isc/endian.h> 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 <isc/endian.h>, so that it only gets
evaluated when more specific platform determination criteria are not
met. Also include <byteswap.h> 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.
#pragma once
-#if defined(__linux__) || defined(__CYGWIN__)
-
-#include <endian.h>
-
-#elif defined __APPLE__
+#if defined __APPLE__
#include <libkern/OSByteOrder.h>
# define bswap_32(x) BSWAP_32(x)
# define bswap_64(x) BSWAP_64(x)
+#elif defined(__ANDROID__) || defined(__CYGWIN__) || \
+ defined(__GNUC__) || defined(__GNU__)
+
+# include <byteswap.h>
+# include <endian.h>
+
#else
#endif /* Specific platform support */