1 | /* |
2 | Copyright Ruslan Baratov 2017 |
3 | Copyright Rene Rivera 2017 |
4 | Distributed under the Boost Software License, Version 1.0. |
5 | (See accompanying file LICENSE_1_0.txt or copy at |
6 | http://www.boost.org/LICENSE_1_0.txt) |
7 | */ |
8 | |
9 | #ifndef BOOST_PREDEF_PLAT_IOS_H |
10 | #define BOOST_PREDEF_PLAT_IOS_H |
11 | |
12 | #include <boost/predef/os/ios.h> // BOOST_OS_IOS |
13 | #include <boost/predef/version_number.h> // BOOST_VERSION_NUMBER_NOT_AVAILABLE |
14 | |
15 | /*` |
16 | [heading `BOOST_PLAT_IOS_DEVICE`] |
17 | [heading `BOOST_PLAT_IOS_SIMULATOR`] |
18 | |
19 | [table |
20 | [[__predef_symbol__] [__predef_version__]] |
21 | |
22 | [[`TARGET_IPHONE_SIMULATOR`] [__predef_detection__]] |
23 | [[`TARGET_OS_SIMULATOR`] [__predef_detection__]] |
24 | ] |
25 | */ |
26 | |
27 | #define BOOST_PLAT_IOS_DEVICE BOOST_VERSION_NUMBER_NOT_AVAILABLE |
28 | #define BOOST_PLAT_IOS_SIMULATOR BOOST_VERSION_NUMBER_NOT_AVAILABLE |
29 | |
30 | // https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h |
31 | #if BOOST_OS_IOS |
32 | # include <TargetConditionals.h> |
33 | # if defined(TARGET_OS_SIMULATOR) && (TARGET_OS_SIMULATOR == 1) |
34 | # undef BOOST_PLAT_IOS_SIMULATOR |
35 | # define BOOST_PLAT_IOS_SIMULATOR BOOST_VERSION_NUMBER_AVAILABLE |
36 | # elif defined(TARGET_IPHONE_SIMULATOR) && (TARGET_IPHONE_SIMULATOR == 1) |
37 | # undef BOOST_PLAT_IOS_SIMULATOR |
38 | # define BOOST_PLAT_IOS_SIMULATOR BOOST_VERSION_NUMBER_AVAILABLE |
39 | # else |
40 | # undef BOOST_PLAT_IOS_DEVICE |
41 | # define BOOST_PLAT_IOS_DEVICE BOOST_VERSION_NUMBER_AVAILABLE |
42 | # endif |
43 | #endif |
44 | |
45 | #if BOOST_PLAT_IOS_SIMULATOR |
46 | # define BOOST_PLAT_IOS_SIMULATOR_AVAILABLE |
47 | # include <boost/predef/detail/platform_detected.h> |
48 | #endif |
49 | |
50 | #if BOOST_PLAT_IOS_DEVICE |
51 | # define BOOST_PLAT_IOS_DEVICE_AVAILABLE |
52 | # include <boost/predef/detail/platform_detected.h> |
53 | #endif |
54 | |
55 | #define BOOST_PLAT_IOS_SIMULATOR_NAME "iOS Simulator" |
56 | #define BOOST_PLAT_IOS_DEVICE_NAME "iOS Device" |
57 | |
58 | #endif // BOOST_PREDEF_PLAT_IOS_H |
59 | |
60 | #include <boost/predef/detail/test.h> |
61 | BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_IOS_SIMULATOR,BOOST_PLAT_IOS_SIMULATOR_NAME) |
62 | BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_IOS_DEVICE,BOOST_PLAT_IOS_DEVICE_NAME) |
63 | |