From a340a52605a01983a59e6fcb09669fe54b96c684 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 10 Jan 2019 13:27:41 -0600 Subject: [PATCH] Add PLAT_ANDROID and deprecate OS_ANDROID. Fixes #41 #81 --- doc/history.qbk | 3 ++ include/boost/predef/os.h | 3 +- include/boost/predef/os/android.h | 3 ++ include/boost/predef/platform.h | 1 + include/boost/predef/platform/android.h | 43 +++++++++++++++++++++++++ 5 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 include/boost/predef/platform/android.h diff --git a/doc/history.qbk b/doc/history.qbk index 509dc1b..8e80346 100644 --- a/doc/history.qbk +++ b/doc/history.qbk @@ -9,6 +9,9 @@ http://www.boost.org/LICENSE_1_0.txt) [heading 1.10] +* Add `BOOST_PLAT_ANDROID` to resolve conflict between Linux and Android + OS predefs. The `BOOST_OS_ANDROID` predef is now deprecated and will be + removed in a future release. * Add support for consuming Predef as a CMake project. [heading 1.9] diff --git a/include/boost/predef/os.h b/include/boost/predef/os.h index bedf99e..9a9f9c6 100644 --- a/include/boost/predef/os.h +++ b/include/boost/predef/os.h @@ -13,7 +13,6 @@ http://www.boost.org/LICENSE_1_0.txt) #include #include -#include #include #include #include @@ -30,4 +29,6 @@ http://www.boost.org/LICENSE_1_0.txt) #include #include +#include + #endif diff --git a/include/boost/predef/os/android.h b/include/boost/predef/os/android.h index 125dbde..564423f 100644 --- a/include/boost/predef/os/android.h +++ b/include/boost/predef/os/android.h @@ -14,6 +14,9 @@ http://www.boost.org/LICENSE_1_0.txt) /*` [heading `BOOST_OS_ANDROID`] +NOTE: `BOOST_OS_ANDROID` is deprecated, and will be removed in a following release. +Please use `BOOST_PLAT_ANDROID` instead. + [@http://en.wikipedia.org/wiki/Android_%28operating_system%29 Android] operating system. [table diff --git a/include/boost/predef/platform.h b/include/boost/predef/platform.h index 6c366d5..65a0e2a 100644 --- a/include/boost/predef/platform.h +++ b/include/boost/predef/platform.h @@ -11,6 +11,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_PLATFORM_H #endif +#include #include #include #include diff --git a/include/boost/predef/platform/android.h b/include/boost/predef/platform/android.h new file mode 100644 index 0000000..485382f --- /dev/null +++ b/include/boost/predef/platform/android.h @@ -0,0 +1,43 @@ +/* +Copyright Rene Rivera 2015-2019 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_PLAT_ANDROID_H +#define BOOST_PREDEF_PLAT_ANDROID_H + +#include +#include + +/*` +[heading `BOOST_PLAT_ANDROID`] + +[@http://en.wikipedia.org/wiki/Android_%28operating_system%29 Android] platform. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__ANDROID__`] [__predef_detection__]] + ] + */ + +#define BOOST_PLAT_ANDROID BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__ANDROID__) +# undef BOOST_PLAT_ANDROID +# define BOOST_PLAT_ANDROID BOOST_VERSION_NUMBER_AVAILABLE +#endif + +#if BOOST_PLAT_ANDROID +# define BOOST_PLAT_ANDROID_AVAILABLE +# include +#endif + +#define BOOST_PLAT_ANDROID_NAME "Android" + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_ANDROID,BOOST_PLAT_ANDROID_NAME)