From b8c1e9ca63136e0c1ef4e4cd0b5b78f20b68323b Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 9 Jun 2016 09:47:13 +1000 Subject: [PATCH] Big endian fix for Solaris Sparc courtesy of joelfredrikson. --- lrzip_private.h | 4 ++++ rzip.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lrzip_private.h b/lrzip_private.h index 4a79918..fa29f44 100644 --- a/lrzip_private.h +++ b/lrzip_private.h @@ -67,6 +67,10 @@ void *alloca (size_t); # include #endif #ifndef __BYTE_ORDER +# ifndef __BIG_ENDIAN +# define __BIG_ENDIAN 4321 +# define __LITTLE_ENDIAN 1234 +# endif # ifdef WORDS_BIGENDIAN # define __BYTE_ORDER __BIG_ENDIAN # else diff --git a/rzip.c b/rzip.c index 38d7fc7..0320515 100644 --- a/rzip.c +++ b/rzip.c @@ -772,7 +772,7 @@ static inline void init_hash_indexes(struct rzip_state *st) st->hash_index[i] = ((random() << 16) ^ random()); } -#if defined(__APPLE__) || defined(__FreeBSD__) +#if !defined(__linux) # define mremap fake_mremap static inline void *fake_mremap(void *old_address, size_t old_size, size_t new_size, int flags __UNUSED__)