Skip to content

Conversation

@KevinRoebert
Copy link

This PR adds support (allows compilation) for Android. On Android the standard location is not <sys/termios.h>, instead <termios.h>.

The Android NDK has the __ANDROID__ macro that can be used (clang also) when used as a standalone toolchain, the Android.mk sets the ANDROID macro. So I've checked for both.

@KevinRoebert
Copy link
Author

@jselbie any update?

@chuangqi
Copy link

chuangqi commented Jan 22, 2022 via email

#elif __has_include(<sys/termios.h>)
#include <sys/termios.h>
#endif

Copy link
Owner

@jselbie jselbie Jan 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since has_include isn't standard, please wrap with macro to detect GCC/G++

#ifdef __GNUC__
#if __has_include(<termios.h>)
#include <termios.h>
#elif __has_include(<sys/termios.h>)
#include <sys/termios.h>
#endif
#else
#include <termios.h>
#endif

Repository owner deleted a comment from Neustradamus Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants