blob: 3a574a6b90ba87e19358f9818dee22db6e98f098 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
diff -uNr unace-2.5.orig/source/base/all/all.h unace-2.5/source/base/all/all.h
--- unace-2.5.orig/source/base/all/all.h 2010-08-03 14:22:49.809269706 +0000
+++ unace-2.5/source/base/all/all.h 2010-08-03 14:29:10.189469638 +0000
@@ -61,7 +61,7 @@
#define put_unaligned(ptr, val) ((void)( *(ptr) = (val) ))
#endif /* __EMULATE_UNALIGNED__ */
-#ifdef __BIG_ENDIAN__
+#if __BYTE_ORDER == __BIG_ENDIAN
#define ADJUST_ENDIANNESS16(Ptr) {\
USHORT x = get_unaligned((USHORT*) (Ptr));\
put_unaligned((USHORT*) (Ptr), x >> 8 | x << 8);\
@@ -78,10 +78,12 @@
x2 = x2 >> 16 | x2 << 16;\
put_unaligned(((ULONG*) (Ptr)), (x2&0xff00ff00) >> 8 | (x2&0x00ff00ff) << 8);\
}
-#else
+#elif __BYTE_ORDER == __LITTLE_ENDIAN
#define ADJUST_ENDIANNESS16(Ptr)
#define ADJUST_ENDIANNESS32(Ptr)
#define ADJUST_ENDIANNESS64(Ptr)
+#else
+#error Please define system endianness
#endif
#endif
|