From 27b6136102239af080f596d2bb0190e098d81791 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Thu, 24 May 2018 12:59:26 -0400 Subject: [PATCH] handle htobe32 et al. on glibc systems with a non-Linux kernel This fix copies over an updated #if clause from libknot's src/contrib/endian.h. This should resolve: https://gitlab.labs.nic.cz/knot/knot-resolver/issues/348 See also discussion about this same problem in libknot from a couple years ago: https://bugs.debian.org/840460 I note that contrib/wire.h in knot-resolver is out of sync with src/contrib/wire.h (and src/contrib/endian.h) from libknot. I don't know whether there's any upstream preference for keeping these in sync in some more reliable way than manual comparisons. For now i'm just providing a narrow fix for the specific problem. --- contrib/wire.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/wire.h b/contrib/wire.h index e0360fe3d..b02296e08 100644 --- a/contrib/wire.h +++ b/contrib/wire.h @@ -27,7 +27,8 @@ #include #include -#if defined(__linux__) +#if defined(__linux__) || defined(__gnu_hurd__) || \ + (defined(__FreeBSD_kernel__) && defined(__GLIBC__)) # include # ifndef be64toh # include -- 2.47.2