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.
#include <stdint.h>
#include <string.h>
-#if defined(__linux__)
+#if defined(__linux__) || defined(__gnu_hurd__) || \
+ (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
# include <endian.h>
# ifndef be64toh
# include <arpa/inet.h>