package/rpi-userland: don't install file in random location
[buildroot-gz.git] / package / lua-periphery / 0002-Fix-build-on-SPARC.patch
blobce461ddca283ee1f579e9e9806d4444b5a0b050a
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
5 the kernel headers.
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
23 @@ -70,10 +70,18 @@
24 case 1152000: return B1152000;
25 case 1500000: return B1500000;
26 case 2000000: return B2000000;
27 +#ifdef B2500000
28 case 2500000: return B2500000;
29 +#endif
30 +#ifdef B3000000
31 case 3000000: return B3000000;
32 +#endif
33 +#ifdef B3500000
34 case 3500000: return B3500000;
35 +#endif
36 +#ifdef B4000000
37 case 4000000: return B4000000;
38 +#endif
39 default: return -1;
42 @@ -107,10 +115,18 @@
43 case B1152000: return 1152000;
44 case B1500000: return 1500000;
45 case B2000000: return 2000000;
46 +#ifdef B2500000
47 case B2500000: return 2500000;
48 +#endif
49 +#ifdef B3000000
50 case B3000000: return 3000000;
51 +#endif
52 +#ifdef B3500000
53 case B3500000: return 3500000;
54 +#endif
55 +#ifdef B4000000
56 case B4000000: return 4000000;
57 +#endif
58 default: return -1;