board/csky: fixup gdb instructions in readme.txt
[buildroot-gz.git] / package / gutenprint / 0003-print-olympus.c-fix-endianness-detection.patch
blobfc1746ca0014abf7b335be181bff4d0a8204fa98
1 From e0dad4bb237f1155e920c30c6fd3412e96a3e84d Mon Sep 17 00:00:00 2001
2 From: Olivier Schonken <olivier.schonken@gmail.com>
3 Date: Sun, 24 Jan 2016 17:14:21 +0200
4 Subject: [PATCH 1/1] print-olympus.c: fix endianness detection
6 The __LITTLE_ENDIAN__ and __BIG_ENDIAN__ macros are not a reliable way to
7 detect endianness. Instead, rely on __BYTE_ORDER like we do in the rest of
8 the code.
10 Signed-off-by: Olivier Schonken <olivier.schonken@gmail.com>
11 ---
12 src/main/print-olympus.c | 4 ++--
13 1 file changed, 2 insertions(+), 2 deletions(-)
15 diff --git a/src/main/print-olympus.c b/src/main/print-olympus.c
16 index 42c4897..8b2aa80 100644
17 --- a/src/main/print-olympus.c
18 +++ b/src/main/print-olympus.c
19 @@ -4901,9 +4901,9 @@ dyesub_do_print(stp_vars_t *v, stp_image_t *image)
22 if (pv.bytes_per_ink_channel > 1) {
23 -#if defined(__LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN__)
24 +#if (__BYTE_ORDER == __LITTLE_ENDIAN)
25 pv.byteswap = dyesub_feature(caps, DYESUB_FEATURE_BIGENDIAN);
26 -#elif defined (__BIG_ENDIAN) || defined(__BIG_ENDIAN__)
27 +#elif (__BYTE_ORDER == __BIG_ENDIAN)
28 pv.byteswap = !dyesub_feature(caps, DYESUB_FEATURE_BIGENDIAN);
29 #else
30 #error "Unable to determine endianness, aborting compilation!"
31 --
32 1.9.1