diff --git a/lib/isc/include/isc/endian.h b/lib/isc/include/isc/endian.h index 3c7ffbc298..153fa00f41 100644 --- a/lib/isc/include/isc/endian.h +++ b/lib/isc/include/isc/endian.h @@ -13,8 +13,7 @@ #pragma once -#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || \ - defined(__OpenBSD__) || defined(__bsdi__) +#ifdef HAVE_SYS_ENDIAN_H #include @@ -32,7 +31,7 @@ #define le64toh(x) letoh64(x) #endif /* !be16toh */ -#elif defined __APPLE__ +#elif defined(__APPLE__) /* * macOS has its own byte-swapping routines, so use these. diff --git a/meson.build b/meson.build index 03f03f71f2..91d4924356 100644 --- a/meson.build +++ b/meson.build @@ -538,6 +538,7 @@ foreach h : [ 'regex.h', 'stdckdint.h', 'sys/mman.h', + 'sys/endian.h', 'sys/select.h', 'sys/sockio.h', 'sys/sysctl.h',