Opened 6 years ago
#12863 new Bugs
some API detection #ifdefs not valid
Reported by: | Owned by: | chris_kohlhoff | |
---|---|---|---|
Milestone: | To Be Determined | Component: | asio |
Version: | Boost 1.61.0 | Severity: | Problem |
Keywords: | Cc: | danalbert@… |
Description
There are a couple of guards checking for APIs that are quite fragile and do not work with the latest Android NDK: (your spam detection captcha isn't working, it's issue #302 on the android-ndk/ndk github project)
The first is assuming cfsetspeed
is available if _BSD_SOURCE
is set: https://github.com/boostorg/asio/blob/develop/include/boost/asio/impl/serial_port_base.ipp#L117
_BSD_SOURCE
is something the user defines if they want access to the BSD extensions, and indicates nothing about what the implementation provides.
Second is guarding epoll_create1
based on the presence of EPOLL_CLOEXEC
: https://github.com/boostorg/asio/blob/develop/include/boost/asio/detail/impl/epoll_reactor.ipp#L462
This breaks implementations like the following:
#define EPOLL_CLOEXEC O_CLOEXEC int epoll_create1(int) __attribute__((availability(android,introduced=21)));
(Android here is just an example, this could well be the case on other platforms)