From: Otto Moerbeek Date: Thu, 6 Nov 2025 08:07:12 +0000 (+0100) Subject: We're runing on a posix system, so we can expect endian.h to exist X-Git-Tag: rec-5.4.0-alpha1~121^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71e81f3e8db6e95cac5bffb43d42c41f8bcabac8;p=thirdparty%2Fpdns.git We're runing on a posix system, so we can expect endian.h to exist Should fix #16091 Signed-off-by: Otto Moerbeek --- diff --git a/ext/protozero/include/protozero/config.hpp b/ext/protozero/include/protozero/config.hpp index 6fc7749049..68481d2c76 100644 --- a/ext/protozero/include/protozero/config.hpp +++ b/ext/protozero/include/protozero/config.hpp @@ -18,6 +18,14 @@ documentation. * @brief Contains macro checks for different configurations. */ +#if __has_include() +#include // Recent posix +#elif __has_include() +#include // Common place on older BSD derived systems +#else +#error no endian.h found +#endif + #define PROTOZERO_LITTLE_ENDIAN 1234 #define PROTOZERO_BIG_ENDIAN 4321 @@ -35,6 +43,9 @@ documentation. # define PROTOZERO_BYTE_ORDER PROTOZERO_LITTLE_ENDIAN #endif +// Sanity check +static_assert(PROTOZERO_BYTE_ORDER == BYTE_ORDER); + // Check whether __builtin_bswap is available #if defined(__GNUC__) || defined(__clang__) # define PROTOZERO_USE_BUILTIN_BSWAP