]> sigrok.org Git - libserialport.git/commitdiff
android: Fix build compatibility with NDK platform 21 and up.
authorMartin Ling <redacted>
Sat, 4 Jan 2020 23:00:17 +0000 (23:00 +0000)
committerMartin Ling <redacted>
Sat, 4 Jan 2020 23:00:17 +0000 (23:00 +0000)
In platforms 21 and higher of the NDK, linux/serial.h is available,
which it was not before. This broke the build, because the configure
script would detect the availability of 'struct serial_struct' in that
header and set HAVE_STRUCT_SERIAL_STRUCT, but the #ifndef __ANDROID__
in libserialport_internal.h stopped us actually including the header.

This change fixes things to build with all versions of the NDK, and is
tested with builds for arm from versions 9 to 24.

Version 21 also added availability of tcdrain(), so we also use that
where available, and only use the direct ioctl() method on NDK < 21.

Fixes #1078.


No differences found