libserial: fix build on sparc
On certain architectures (namely Sparc), the maximum baud rate exposed
by the kernel headers is
B2000000. Therefore, the current libserial
code doesn't build for the Sparc and Sparc64 architectures due to
this.
In order to address this problem, this patch tests the value of
__MAX_BAUD. If it's higher than
B2000000 then we assume we're on an
architecture that supports all baud rates up to
B4000000. Otherwise,
we simply don't support the baud rates above
B2000000.
Fixes build failures such as:
SerialPort.cpp: In member function 'int LibSerial::SerialPort::Implementation::GetBitRate(const LibSerial::BaudRate&) const':
SerialPort.cpp:1226:14: error: 'BAUD_2000000' is not a member of 'LibSerial::BaudRate'
case BaudRate::BAUD_2000000:
Fixes:
- http://autobuild.buildroot.org/results/
63ba95b6786464fa8e75af64593010df84530079
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>