logrotate: fix build with gcc 6
[buildroot-gz.git] / package / c-periphery / 0002-Fix-build-on-SPARC.patch
blobe491f6f728e11d64c205a912ff5ae46d7d4ac17f
1 From 295316c3f44c3e779e85d7453424496a3bb4bc48 Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Sat, 8 Aug 2015 22:56:09 +0200
4 Subject: [PATCH] Fix build on SPARC
6 On SPARC, the definitions of B2500000, B3000000, B3500000 and B4000000
7 are not necessarily available, so use those values only if defined in
8 the kernel headers.
10 It fixes SPARC build failures such as:
12 src/serial.c: In function '_serial_baudrate_to_bits':
13 src/serial.c:73:30: error: 'B2500000' undeclared (first use in this function)
14 case 2500000: return B2500000;
16 src/serial.c:73:30: note: each undeclared identifier is reported only once for each function it appears in
17 src/serial.c:74:30: error: 'B3000000' undeclared (first use in this function)
18 case 3000000: return B3000000;
21 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
22 ---
23 src/serial.c | 16 ++++++++++++++++
24 1 file changed, 16 insertions(+)
26 diff --git a/src/serial.c b/src/serial.c
27 index e385309..efd425e 100644
28 --- a/src/serial.c
29 +++ b/src/serial.c
30 @@ -70,10 +70,18 @@ static int _serial_baudrate_to_bits(uint32_t baudrate) {
31 case 1152000: return B1152000;
32 case 1500000: return B1500000;
33 case 2000000: return B2000000;
34 +#ifdef B2500000
35 case 2500000: return B2500000;
36 +#endif
37 +#ifdef B3000000
38 case 3000000: return B3000000;
39 +#endif
40 +#ifdef B3500000
41 case 3500000: return B3500000;
42 +#endif
43 +#ifdef B4000000
44 case 4000000: return B4000000;
45 +#endif
46 default: return -1;
49 @@ -107,10 +115,18 @@ static int _serial_bits_to_baudrate(uint32_t bits) {
50 case B1152000: return 1152000;
51 case B1500000: return 1500000;
52 case B2000000: return 2000000;
53 +#ifdef B2500000
54 case B2500000: return 2500000;
55 +#endif
56 +#ifdef B3000000
57 case B3000000: return 3000000;
58 +#endif
59 +#ifdef B3500000
60 case B3500000: return 3500000;
61 +#endif
62 +#ifdef B4000000
63 case B4000000: return 4000000;
64 +#endif
65 default: return -1;
68 --
69 2.5.0