1 [PATCH] Fix build on SPARC
3 On SPARC, the definitions of B2500000, B3000000, B3500000 and B4000000
4 are not necessarily available, so use those values only if defined in
7 It fixes SPARC build failures such as:
9 src/serial.c: In function '_serial_baudrate_to_bits':
10 src/serial.c:73:30: error: 'B2500000' undeclared (first use in this function)
11 case 2500000: return B2500000;
13 src/serial.c:73:30: note: each undeclared identifier is reported only once for each function it appears in
14 src/serial.c:74:30: error: 'B3000000' undeclared (first use in this function)
15 case 3000000: return B3000000;
17 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
19 Index: b/lua-periphery/c-periphery/src/serial.c
20 ===================================================================
21 --- a/lua-periphery/c-periphery/src/serial.c
22 +++ b/lua-periphery/c-periphery/src/serial.c
24 case 1152000: return B1152000;
25 case 1500000: return B1500000;
26 case 2000000: return B2000000;
28 case 2500000: return B2500000;
31 case 3000000: return B3000000;
34 case 3500000: return B3500000;
37 case 4000000: return B4000000;
43 case B1152000: return 1152000;
44 case B1500000: return 1500000;
45 case B2000000: return 2000000;
47 case B2500000: return 2500000;
50 case B3000000: return 3000000;
53 case B3500000: return 3500000;
56 case B4000000: return 4000000;