From ba7668860c5920f443c1f0a8aeabb6538b1d6b91 Mon Sep 17 00:00:00 2001 From: Franz Detro Date: Tue, 25 Feb 2014 17:08:06 +0100 Subject: [PATCH 1/6] created a copy of macos.h as basis for ios.h --- include/boost/predef/os/ios.h | 58 +++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 include/boost/predef/os/ios.h diff --git a/include/boost/predef/os/ios.h b/include/boost/predef/os/ios.h new file mode 100644 index 0000000..f71ddfb --- /dev/null +++ b/include/boost/predef/os/ios.h @@ -0,0 +1,58 @@ +/* +Copyright Rene Rivera 2008-2013 +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_OS_MACOS_H +#define BOOST_PREDEF_OS_MACOS_H + +#include +#include + +/*` +[heading `BOOST_OS_MACOS`] + +[@http://en.wikipedia.org/wiki/Mac_OS Mac OS] operating system. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`macintosh`] [__predef_detection__]] + [[`Macintosh`] [__predef_detection__]] + [[`__APPLE__`] [__predef_detection__]] + [[`__MACH__`] [__predef_detection__]] + + [[`__APPLE__`, `__MACH__`] [10.0.0]] + [[ /otherwise/ ] [9.0.0]] + ] + */ + +#define BOOST_OS_MACOS BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \ + defined(macintosh) || defined(Macintosh) || \ + (defined(__APPLE__) && defined(__MACH__)) \ + ) +# undef BOOST_OS_MACOS +# if !defined(BOOST_OS_MACOS) && defined(__APPLE__) && defined(__MACH__) +# define BOOST_OS_MACOS BOOST_VERSION_NUMBER(10,0,0) +# endif +# if !defined(BOOST_OS_MACOS) +# define BOOST_OS_MACOS BOOST_VERSION_NUMBER(9,0,0) +# endif +#endif + +#if BOOST_OS_MACOS +# define BOOST_OS_MACOS_AVAILABLE +# include +#endif + +#define BOOST_OS_MACOS_NAME "Mac OS" + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_OS_MACOS,BOOST_OS_MACOS_NAME) + + +#endif From e3a435add25b991a54287b6de897cbcf6f1fbb1d Mon Sep 17 00:00:00 2001 From: Franz Detro Date: Wed, 26 Feb 2014 08:59:58 +0100 Subject: [PATCH 2/6] add detection of Apple iOS (BOOST_OS_IOS) --- include/boost/predef/os.h | 1 + include/boost/predef/os/ios.h | 37 +++++++++++++-------------------- include/boost/predef/os/macos.h | 4 +++- 3 files changed, 19 insertions(+), 23 deletions(-) diff --git a/include/boost/predef/os.h b/include/boost/predef/os.h index 3aceb3a..c74192e 100644 --- a/include/boost/predef/os.h +++ b/include/boost/predef/os.h @@ -16,6 +16,7 @@ http://www.boost.org/LICENSE_1_0.txt) #include #include #include +#include #include #include #include diff --git a/include/boost/predef/os/ios.h b/include/boost/predef/os/ios.h index f71ddfb..a62fb49 100644 --- a/include/boost/predef/os/ios.h +++ b/include/boost/predef/os/ios.h @@ -5,54 +5,47 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ -#ifndef BOOST_PREDEF_OS_MACOS_H -#define BOOST_PREDEF_OS_MACOS_H +#ifndef BOOST_PREDEF_OS_IOS_H +#define BOOST_PREDEF_OS_IOS_H #include #include /*` -[heading `BOOST_OS_MACOS`] +[heading `BOOST_OS_IOS`] -[@http://en.wikipedia.org/wiki/Mac_OS Mac OS] operating system. +[@http://en.wikipedia.org/wiki/iOS iOS] operating system. [table [[__predef_symbol__] [__predef_version__]] - [[`macintosh`] [__predef_detection__]] - [[`Macintosh`] [__predef_detection__]] [[`__APPLE__`] [__predef_detection__]] [[`__MACH__`] [__predef_detection__]] + [[`__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__`] [__predef_detection__]] - [[`__APPLE__`, `__MACH__`] [10.0.0]] - [[ /otherwise/ ] [9.0.0]] + [[`__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__`] [__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__*1000]] ] */ -#define BOOST_OS_MACOS BOOST_VERSION_NUMBER_NOT_AVAILABLE +#define BOOST_OS_IOS BOOST_VERSION_NUMBER_NOT_AVAILABLE #if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \ - defined(macintosh) || defined(Macintosh) || \ - (defined(__APPLE__) && defined(__MACH__)) \ + defined(__APPLE__) && defined(__MACH__) && \ + defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) \ ) -# undef BOOST_OS_MACOS -# if !defined(BOOST_OS_MACOS) && defined(__APPLE__) && defined(__MACH__) -# define BOOST_OS_MACOS BOOST_VERSION_NUMBER(10,0,0) -# endif -# if !defined(BOOST_OS_MACOS) -# define BOOST_OS_MACOS BOOST_VERSION_NUMBER(9,0,0) -# endif +# undef BOOST_OS_IOS +# define BOOST_OS_IOS (__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__*1000) #endif -#if BOOST_OS_MACOS -# define BOOST_OS_MACOS_AVAILABLE +#if BOOST_OS_IOS +# define BOOST_OS_IOS_AVAILABLE # include #endif -#define BOOST_OS_MACOS_NAME "Mac OS" +#define BOOST_OS_IOS_NAME "iOS" #include -BOOST_PREDEF_DECLARE_TEST(BOOST_OS_MACOS,BOOST_OS_MACOS_NAME) +BOOST_PREDEF_DECLARE_TEST(BOOST_OS_IOS,BOOST_OS_IOS_NAME) #endif diff --git a/include/boost/predef/os/macos.h b/include/boost/predef/os/macos.h index f71ddfb..1d34ece 100644 --- a/include/boost/predef/os/macos.h +++ b/include/boost/predef/os/macos.h @@ -23,6 +23,7 @@ http://www.boost.org/LICENSE_1_0.txt) [[`Macintosh`] [__predef_detection__]] [[`__APPLE__`] [__predef_detection__]] [[`__MACH__`] [__predef_detection__]] + [[`!__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__`] [__predef_detection__]] [[`__APPLE__`, `__MACH__`] [10.0.0]] [[ /otherwise/ ] [9.0.0]] @@ -31,7 +32,8 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_MACOS BOOST_VERSION_NUMBER_NOT_AVAILABLE -#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \ +#if !BOOST_PREDEF_DETAIL_OS_DETECTED && \ + !defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && ( \ defined(macintosh) || defined(Macintosh) || \ (defined(__APPLE__) && defined(__MACH__)) \ ) From 2e73899a69c4c706609278168bc49e7ec1227420 Mon Sep 17 00:00:00 2001 From: Franz Detro Date: Wed, 26 Feb 2014 12:23:34 +0100 Subject: [PATCH 3/6] improved detection of ARM platform (check for Apple clang __arm64); set version to 8.0.0 in case of __arm64 (allows check for armv8 targets) --- include/boost/predef/architecture/arm.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/boost/predef/architecture/arm.h b/include/boost/predef/architecture/arm.h index 4c469a5..ea3b512 100644 --- a/include/boost/predef/architecture/arm.h +++ b/include/boost/predef/architecture/arm.h @@ -20,10 +20,12 @@ http://www.boost.org/LICENSE_1_0.txt) [[__predef_symbol__] [__predef_version__]] [[`__arm__`] [__predef_detection__]] + [[`__arm64`] [__predef_detection__]] [[`__thumb__`] [__predef_detection__]] [[`__TARGET_ARCH_ARM`] [__predef_detection__]] [[`__TARGET_ARCH_THUMB`] [__predef_detection__]] + [[`__arm64`] [8.0.0]] [[`__TARGET_ARCH_ARM`] [V.0.0]] [[`__TARGET_ARCH_THUMB`] [V.0.0]] ] @@ -31,9 +33,12 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_ARCH_ARM BOOST_VERSION_NUMBER_NOT_AVAILABLE -#if defined(__arm__) || defined(__thumb__) || \ +#if defined(__arm__) || defined(__arm64) || defined(__thumb__) || \ defined(__TARGET_ARCH_ARM) || defined(__TARGET_ARCH_THUMB) # undef BOOST_ARCH_ARM +# if !defined(BOOST_ARCH_ARM) && defined(__arm64) +# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(8,0,0) +# endif # if !defined(BOOST_ARCH_ARM) && defined(__TARGET_ARCH_ARM) # define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(__TARGET_ARCH_ARM,0,0) # endif From 604f0d35b7da123a52fab91a0c7545656556bf9a Mon Sep 17 00:00:00 2001 From: Franz Detro Date: Wed, 12 Mar 2014 14:05:14 +0100 Subject: [PATCH 4/6] adjusted copyrights as requested by review --- include/boost/predef/architecture/arm.h | 1 + include/boost/predef/os.h | 1 + include/boost/predef/os/ios.h | 2 +- include/boost/predef/os/macos.h | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/boost/predef/architecture/arm.h b/include/boost/predef/architecture/arm.h index ea3b512..7f84111 100644 --- a/include/boost/predef/architecture/arm.h +++ b/include/boost/predef/architecture/arm.h @@ -1,5 +1,6 @@ /* Copyright Rene Rivera 2008-2013 +Copyright Franz Detro 2014 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) diff --git a/include/boost/predef/os.h b/include/boost/predef/os.h index c74192e..628eb4f 100644 --- a/include/boost/predef/os.h +++ b/include/boost/predef/os.h @@ -1,5 +1,6 @@ /* Copyright Rene Rivera 2008-2012 +Copyright Franz Detro 2014 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) diff --git a/include/boost/predef/os/ios.h b/include/boost/predef/os/ios.h index a62fb49..97e1bb8 100644 --- a/include/boost/predef/os/ios.h +++ b/include/boost/predef/os/ios.h @@ -1,5 +1,5 @@ /* -Copyright Rene Rivera 2008-2013 +Copyright Franz Detro 2014 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) diff --git a/include/boost/predef/os/macos.h b/include/boost/predef/os/macos.h index 1d34ece..0ace2f5 100644 --- a/include/boost/predef/os/macos.h +++ b/include/boost/predef/os/macos.h @@ -1,5 +1,6 @@ /* Copyright Rene Rivera 2008-2013 +Franz Detro 2014 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) From 96ce033128f252d1dc6918c733675d983545c2de Mon Sep 17 00:00:00 2001 From: Franz Detro Date: Wed, 12 Mar 2014 14:06:17 +0100 Subject: [PATCH 5/6] changed MacOS vs. iOS detection to match policies of library --- include/boost/predef/os/macos.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/include/boost/predef/os/macos.h b/include/boost/predef/os/macos.h index 0ace2f5..aa9a92c 100644 --- a/include/boost/predef/os/macos.h +++ b/include/boost/predef/os/macos.h @@ -9,6 +9,13 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_OS_MACOS_H #define BOOST_PREDEF_OS_MACOS_H +/* Special case: iOS will define the same predefs as MacOS, and additionally + '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__'. We can guard against that, + but only if we detect iOS first. Hence we will force include iOS detection + * before doing any MacOS detection. + */ +#include + #include #include @@ -24,7 +31,6 @@ http://www.boost.org/LICENSE_1_0.txt) [[`Macintosh`] [__predef_detection__]] [[`__APPLE__`] [__predef_detection__]] [[`__MACH__`] [__predef_detection__]] - [[`!__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__`] [__predef_detection__]] [[`__APPLE__`, `__MACH__`] [10.0.0]] [[ /otherwise/ ] [9.0.0]] @@ -33,8 +39,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_MACOS BOOST_VERSION_NUMBER_NOT_AVAILABLE -#if !BOOST_PREDEF_DETAIL_OS_DETECTED && \ - !defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && ( \ +#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \ defined(macintosh) || defined(Macintosh) || \ (defined(__APPLE__) && defined(__MACH__)) \ ) From 9e5f79735cd65cb429cf2f6c2d16cb74d14ad185 Mon Sep 17 00:00:00 2001 From: Franz Detro Date: Wed, 12 Mar 2014 14:09:22 +0100 Subject: [PATCH 6/6] added missing 'Copyright' --- include/boost/predef/os/macos.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/predef/os/macos.h b/include/boost/predef/os/macos.h index aa9a92c..9fd8d2a 100644 --- a/include/boost/predef/os/macos.h +++ b/include/boost/predef/os/macos.h @@ -1,6 +1,6 @@ /* Copyright Rene Rivera 2008-2013 -Franz Detro 2014 +Copyright Franz Detro 2014 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)