mirror of
https://github.com/boostorg/predef.git
synced 2025-07-31 20:24:26 +02:00
Merge pull request #2 from fdetro/os-ios
Add support for Apple iOS and improve detection of arm architecture. Thanks to Franz Detro for the changes.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright Rene Rivera 2008-2013
|
Copyright Rene Rivera 2008-2013
|
||||||
|
Copyright Franz Detro 2014
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
Distributed under the Boost Software License, Version 1.0.
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
(See accompanying file LICENSE_1_0.txt or copy at
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
http://www.boost.org/LICENSE_1_0.txt)
|
||||||
@@ -20,10 +21,12 @@ http://www.boost.org/LICENSE_1_0.txt)
|
|||||||
[[__predef_symbol__] [__predef_version__]]
|
[[__predef_symbol__] [__predef_version__]]
|
||||||
|
|
||||||
[[`__arm__`] [__predef_detection__]]
|
[[`__arm__`] [__predef_detection__]]
|
||||||
|
[[`__arm64`] [__predef_detection__]]
|
||||||
[[`__thumb__`] [__predef_detection__]]
|
[[`__thumb__`] [__predef_detection__]]
|
||||||
[[`__TARGET_ARCH_ARM`] [__predef_detection__]]
|
[[`__TARGET_ARCH_ARM`] [__predef_detection__]]
|
||||||
[[`__TARGET_ARCH_THUMB`] [__predef_detection__]]
|
[[`__TARGET_ARCH_THUMB`] [__predef_detection__]]
|
||||||
|
|
||||||
|
[[`__arm64`] [8.0.0]]
|
||||||
[[`__TARGET_ARCH_ARM`] [V.0.0]]
|
[[`__TARGET_ARCH_ARM`] [V.0.0]]
|
||||||
[[`__TARGET_ARCH_THUMB`] [V.0.0]]
|
[[`__TARGET_ARCH_THUMB`] [V.0.0]]
|
||||||
]
|
]
|
||||||
@@ -31,9 +34,12 @@ http://www.boost.org/LICENSE_1_0.txt)
|
|||||||
|
|
||||||
#define BOOST_ARCH_ARM BOOST_VERSION_NUMBER_NOT_AVAILABLE
|
#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)
|
defined(__TARGET_ARCH_ARM) || defined(__TARGET_ARCH_THUMB)
|
||||||
# undef BOOST_ARCH_ARM
|
# 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)
|
# if !defined(BOOST_ARCH_ARM) && defined(__TARGET_ARCH_ARM)
|
||||||
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(__TARGET_ARCH_ARM,0,0)
|
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(__TARGET_ARCH_ARM,0,0)
|
||||||
# endif
|
# endif
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright Rene Rivera 2008-2012
|
Copyright Rene Rivera 2008-2012
|
||||||
|
Copyright Franz Detro 2014
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
Distributed under the Boost Software License, Version 1.0.
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
(See accompanying file LICENSE_1_0.txt or copy at
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
http://www.boost.org/LICENSE_1_0.txt)
|
||||||
@@ -16,6 +17,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>
|
||||||
|
51
include/boost/predef/os/ios.h
Normal file
51
include/boost/predef/os/ios.h
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
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)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef BOOST_PREDEF_OS_IOS_H
|
||||||
|
#define BOOST_PREDEF_OS_IOS_H
|
||||||
|
|
||||||
|
#include <boost/predef/version_number.h>
|
||||||
|
#include <boost/predef/make.h>
|
||||||
|
|
||||||
|
/*`
|
||||||
|
[heading `BOOST_OS_IOS`]
|
||||||
|
|
||||||
|
[@http://en.wikipedia.org/wiki/iOS iOS] operating system.
|
||||||
|
|
||||||
|
[table
|
||||||
|
[[__predef_symbol__] [__predef_version__]]
|
||||||
|
|
||||||
|
[[`__APPLE__`] [__predef_detection__]]
|
||||||
|
[[`__MACH__`] [__predef_detection__]]
|
||||||
|
[[`__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__`] [__predef_detection__]]
|
||||||
|
|
||||||
|
[[`__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__`] [__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__*1000]]
|
||||||
|
]
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define BOOST_OS_IOS BOOST_VERSION_NUMBER_NOT_AVAILABLE
|
||||||
|
|
||||||
|
#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
|
||||||
|
defined(__APPLE__) && defined(__MACH__) && \
|
||||||
|
defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) \
|
||||||
|
)
|
||||||
|
# undef BOOST_OS_IOS
|
||||||
|
# define BOOST_OS_IOS (__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__*1000)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if BOOST_OS_IOS
|
||||||
|
# define BOOST_OS_IOS_AVAILABLE
|
||||||
|
# include <boost/predef/detail/os_detected.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define BOOST_OS_IOS_NAME "iOS"
|
||||||
|
|
||||||
|
#include <boost/predef/detail/test.h>
|
||||||
|
BOOST_PREDEF_DECLARE_TEST(BOOST_OS_IOS,BOOST_OS_IOS_NAME)
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright Rene Rivera 2008-2013
|
Copyright Rene Rivera 2008-2013
|
||||||
|
Copyright Franz Detro 2014
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
Distributed under the Boost Software License, Version 1.0.
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
(See accompanying file LICENSE_1_0.txt or copy at
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
http://www.boost.org/LICENSE_1_0.txt)
|
||||||
@@ -8,6 +9,13 @@ http://www.boost.org/LICENSE_1_0.txt)
|
|||||||
#ifndef BOOST_PREDEF_OS_MACOS_H
|
#ifndef BOOST_PREDEF_OS_MACOS_H
|
||||||
#define 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 <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>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user