From: Aydın Mercan Date: Wed, 25 Mar 2026 13:28:48 +0000 (+0300) Subject: include according by checking in meson X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2a62cd449f87c1e66ea31de202d9849fd5995115;p=thirdparty%2Fbind9.git include according by checking in meson The header has existed in macOS since around ~26. This causes the `htobeNN`/`htoleNN` macros to be redefined in in terms of when other system headers include . Fix this issue by using checking for the existence of in meson and including it according to the probe result. --- diff --git a/lib/isc/include/isc/endian.h b/lib/isc/include/isc/endian.h index 3c7ffbc2985..153fa00f411 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 03f03f71f2e..91d49243564 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',