From 589a8defde72fc9585eb81bb72372f5fb18c0d27 Mon Sep 17 00:00:00 2001 From: Evan Nemerson Date: Sat, 12 Mar 2016 10:41:17 -0800 Subject: [PATCH] snappy: big-endian detection https://github.com/quixdb/squash/issues/195 --- plugins/snappy/snappy-stubs-public.h.in | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugins/snappy/snappy-stubs-public.h.in b/plugins/snappy/snappy-stubs-public.h.in index fa22d54..08ebbcb 100644 --- a/plugins/snappy/snappy-stubs-public.h.in +++ b/plugins/snappy/snappy-stubs-public.h.in @@ -58,6 +58,19 @@ #define SNAPPY_VERSION \ ((SNAPPY_MAJOR << 16) | (SNAPPY_MINOR << 8) | SNAPPY_PATCHLEVEL) +#if !defined(_WIN32) +# if !defined(BYTE_ORDER) +# include +# elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) +# include +# else +# include +# endif +# if defined(BYTE_ORDER) && (BYTE_ORDER == BIG_ENDIAN) +# define WORDS_BIGENDIAN +# endif +#endif + #include namespace snappy {