From ac06fb7f29e6c6305cf08a5cdac8fbd73a1f607a Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 3 Jun 2022 12:51:21 -0600 Subject: [PATCH] Define WORDS_BIGENDIAN on big endian systems. Instead of a configure check, we use endian.h (or a fallback). --- lib/protobuf-c/protobuf-c.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/protobuf-c/protobuf-c.c b/lib/protobuf-c/protobuf-c.c index facad2fab..96b750650 100644 --- a/lib/protobuf-c/protobuf-c.c +++ b/lib/protobuf-c/protobuf-c.c @@ -49,9 +49,22 @@ #include /* for malloc, free */ #include /* for strcmp, strlen, memcpy, memmove, memset */ +#if defined(HAVE_ENDIAN_H) +# include +#elif defined(HAVE_SYS_ENDIAN_H) +# include +#elif defined(HAVE_MACHINE_ENDIAN_H) +# include +#else +# include "compat/endian.h" +#endif #include "protobuf-c/protobuf-c.h" +#if BYTE_ORDER == BIG_ENDIAN +# define WORDS_BIGENDIAN +#endif + #define TRUE 1 #define FALSE 0