add detection of Apple iOS (BOOST_OS_IOS)

This commit is contained in:
Franz Detro
2014-02-26 08:59:58 +01:00
parent ba7668860c
commit e3a435add2
3 changed files with 19 additions and 23 deletions

View File

@@ -16,6 +16,7 @@ http://www.boost.org/LICENSE_1_0.txt)
#include <boost/predef/os/cygwin.h> #include <boost/predef/os/cygwin.h>
#include <boost/predef/os/hpux.h> #include <boost/predef/os/hpux.h>
#include <boost/predef/os/irix.h> #include <boost/predef/os/irix.h>
#include <boost/predef/os/ios.h>
#include <boost/predef/os/linux.h> #include <boost/predef/os/linux.h>
#include <boost/predef/os/macos.h> #include <boost/predef/os/macos.h>
#include <boost/predef/os/os400.h> #include <boost/predef/os/os400.h>

View File

@@ -5,54 +5,47 @@ Distributed under the Boost Software License, Version 1.0.
http://www.boost.org/LICENSE_1_0.txt) http://www.boost.org/LICENSE_1_0.txt)
*/ */
#ifndef BOOST_PREDEF_OS_MACOS_H #ifndef BOOST_PREDEF_OS_IOS_H
#define BOOST_PREDEF_OS_MACOS_H #define BOOST_PREDEF_OS_IOS_H
#include <boost/predef/version_number.h> #include <boost/predef/version_number.h>
#include <boost/predef/make.h> #include <boost/predef/make.h>
/*` /*`
[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 [table
[[__predef_symbol__] [__predef_version__]] [[__predef_symbol__] [__predef_version__]]
[[`macintosh`] [__predef_detection__]]
[[`Macintosh`] [__predef_detection__]]
[[`__APPLE__`] [__predef_detection__]] [[`__APPLE__`] [__predef_detection__]]
[[`__MACH__`] [__predef_detection__]] [[`__MACH__`] [__predef_detection__]]
[[`__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__`] [__predef_detection__]]
[[`__APPLE__`, `__MACH__`] [10.0.0]] [[`__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__`] [__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__*1000]]
[[ /otherwise/ ] [9.0.0]]
] ]
*/ */
#define BOOST_OS_MACOS BOOST_VERSION_NUMBER_NOT_AVAILABLE #define BOOST_OS_IOS BOOST_VERSION_NUMBER_NOT_AVAILABLE
#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \ #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 # undef BOOST_OS_IOS
# if !defined(BOOST_OS_MACOS) && defined(__APPLE__) && defined(__MACH__) # define BOOST_OS_IOS (__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__*1000)
# 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 #endif
#if BOOST_OS_MACOS #if BOOST_OS_IOS
# define BOOST_OS_MACOS_AVAILABLE # define BOOST_OS_IOS_AVAILABLE
# include <boost/predef/detail/os_detected.h> # include <boost/predef/detail/os_detected.h>
#endif #endif
#define BOOST_OS_MACOS_NAME "Mac OS" #define BOOST_OS_IOS_NAME "iOS"
#include <boost/predef/detail/test.h> #include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_OS_MACOS,BOOST_OS_MACOS_NAME) BOOST_PREDEF_DECLARE_TEST(BOOST_OS_IOS,BOOST_OS_IOS_NAME)
#endif #endif

View File

@@ -23,6 +23,7 @@ http://www.boost.org/LICENSE_1_0.txt)
[[`Macintosh`] [__predef_detection__]] [[`Macintosh`] [__predef_detection__]]
[[`__APPLE__`] [__predef_detection__]] [[`__APPLE__`] [__predef_detection__]]
[[`__MACH__`] [__predef_detection__]] [[`__MACH__`] [__predef_detection__]]
[[`!__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__`] [__predef_detection__]]
[[`__APPLE__`, `__MACH__`] [10.0.0]] [[`__APPLE__`, `__MACH__`] [10.0.0]]
[[ /otherwise/ ] [9.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 #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(macintosh) || defined(Macintosh) || \
(defined(__APPLE__) && defined(__MACH__)) \ (defined(__APPLE__) && defined(__MACH__)) \
) )