changeset 7451:04c7030f6477

. Fix unpack200 on BSD little endian machines by only swapping bytes when this is actually necessary.
author Greg Lewis <glewis@eyesbeyond.com>
date Wed, 16 Jul 2014 05:08:22 -0700
parents c15028b8a478
children 477b627dc8b1
files src/share/native/com/sun/java/util/jar/pack/zip.cpp
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/com/sun/java/util/jar/pack/zip.cpp	Tue Jul 15 23:20:59 2014 -0700
+++ b/src/share/native/com/sun/java/util/jar/pack/zip.cpp	Wed Jul 16 05:08:22 2014 -0700
@@ -33,6 +33,10 @@
 
 #include <stdlib.h>
 
+#ifdef _ALLBSD_SOURCE
+#include <machine/endian.h>
+#endif
+
 #ifndef _MSC_VER
 #include <strings.h>
 #endif
@@ -62,7 +66,7 @@
 
 #endif // End of ZLIB
 
-#ifdef _BIG_ENDIAN
+#if (BYTE_ORDER == BIG_ENDIAN)
 #define SWAP_BYTES(a) \
     ((((a) << 8) & 0xff00) | 0x00ff) & (((a) >> 8) | 0xff00)
 #else