aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2010-06-12 05:21:29 +0000
committerXin LI <delphij@FreeBSD.org>2010-06-12 05:21:29 +0000
commit41d021435300237a32c279b1e735c289d586f692 (patch)
treed60e10b472c339586350a9d584a791406f8e0558
parentc9a1e85664dd15d3b77da800bacfc3b66f79af3e (diff)
downloadsrc-41d021435300237a32c279b1e735c289d586f692.tar.gz
src-41d021435300237a32c279b1e735c289d586f692.zip
MFC r209078:
Detect bit endianness through machine/endian.h. This fixes xz on big-endian systems. Tested on: sparc64 (kindly provided by linimon), amd64 Approved by: re (kensmith)
Notes
Notes: svn path=/stable/8/; revision=209089
-rw-r--r--lib/liblzma/config.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/liblzma/config.h b/lib/liblzma/config.h
index 223cb9574d06..e7b61bb95f98 100644
--- a/lib/liblzma/config.h
+++ b/lib/liblzma/config.h
@@ -84,6 +84,12 @@
# define __EXTENSIONS__ 1
#endif
#define VERSION "4.999.9beta"
+#if defined(__FreeBSD__)
+#include <machine/endian.h>
+#if _BYTE_ORDER == _BIG_ENDIAN
+# define WORDS_BIGENDIAN 1
+#endif
+#else
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
@@ -93,3 +99,4 @@
/* # undef WORDS_BIGENDIAN */
# endif
#endif
+#endif