From 0033b7c1e42e16834dccd857d9917a172b175a5d Mon Sep 17 00:00:00 2001 From: Gregor Jasny Date: Thu, 14 Mar 2019 15:46:43 +0100 Subject: [PATCH] Android: Use compiler pre-defined __ANDROID__ The ANDROID define us usually originationg from he build system (like CMake, ndk-build, etc.). But some buildsystems like Bazel do not set it which brakes Android platform detection. Better use __ANDROID__ (like boost predef does) which is predefined by the compiler if targeting Android. --- CHANGELOG.md | 6 ++++++ include/boost/beast/core/impl/file_posix.ipp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 443af418..f6d1872e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Version 233: + +* Check __ANDROID__ instead + +-------------------------------------------------------------------------------- + Version 232: * Fix close_socket for net::basic_socket changes diff --git a/include/boost/beast/core/impl/file_posix.ipp b/include/boost/beast/core/impl/file_posix.ipp index 9b837d36..0f7f42ac 100644 --- a/include/boost/beast/core/impl/file_posix.ipp +++ b/include/boost/beast/core/impl/file_posix.ipp @@ -24,7 +24,7 @@ #include #if ! defined(BOOST_BEAST_NO_POSIX_FADVISE) -# if defined(__APPLE__) || (defined(ANDROID) && (__ANDROID_API__ < 21)) +# if defined(__APPLE__) || (defined(__ANDROID__) && (__ANDROID_API__ < 21)) # define BOOST_BEAST_NO_POSIX_FADVISE # endif #endif