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