Gentoo Archives: gentoo-commits

From: "Guy Martin (gmsoft)" <gmsoft@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-arch/unace/files: unace-2.5-endianness-detection.patch
Date: Mon, 23 Aug 2010 09:55:22
Message-Id: 20100823095519.523D020051@flycatcher.gentoo.org
1 gmsoft 10/08/23 09:55:19
2
3 Added: unace-2.5-endianness-detection.patch
4 Log:
5 Fix endianess detection, bug #222301.
6 (Portage version: 2.1.8.3/cvs/Linux parisc64)
7
8 Revision Changes Path
9 1.1 app-arch/unace/files/unace-2.5-endianness-detection.patch
10
11 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-arch/unace/files/unace-2.5-endianness-detection.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-arch/unace/files/unace-2.5-endianness-detection.patch?rev=1.1&content-type=text/plain
13
14 Index: unace-2.5-endianness-detection.patch
15 ===================================================================
16 diff -uNr unace-2.5.orig/source/base/all/all.h unace-2.5/source/base/all/all.h
17 --- unace-2.5.orig/source/base/all/all.h 2010-08-03 14:22:49.809269706 +0000
18 +++ unace-2.5/source/base/all/all.h 2010-08-03 14:29:10.189469638 +0000
19 @@ -61,7 +61,7 @@
20 #define put_unaligned(ptr, val) ((void)( *(ptr) = (val) ))
21 #endif /* __EMULATE_UNALIGNED__ */
22
23 -#ifdef __BIG_ENDIAN__
24 +#if __BYTE_ORDER == __BIG_ENDIAN
25 #define ADJUST_ENDIANNESS16(Ptr) {\
26 USHORT x = get_unaligned((USHORT*) (Ptr));\
27 put_unaligned((USHORT*) (Ptr), x >> 8 | x << 8);\
28 @@ -78,10 +78,12 @@
29 x2 = x2 >> 16 | x2 << 16;\
30 put_unaligned(((ULONG*) (Ptr)), (x2&0xff00ff00) >> 8 | (x2&0x00ff00ff) << 8);\
31 }
32 -#else
33 +#elif __BYTE_ORDER == __LITTLE_ENDIAN
34 #define ADJUST_ENDIANNESS16(Ptr)
35 #define ADJUST_ENDIANNESS32(Ptr)
36 #define ADJUST_ENDIANNESS64(Ptr)
37 +#else
38 +#error Please define system endianness
39 #endif
40
41 #endif