ios.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. #ifndef BOOST_PREDEF_PLAT_IOS_H
  9. #define BOOST_PREDEF_PLAT_IOS_H
  10. #include <boost/predef/os/ios.h> // BOOST_OS_IOS
  11. #include <boost/predef/version_number.h> // BOOST_VERSION_NUMBER_NOT_AVAILABLE
  12. /* tag::reference[]
  13. = `BOOST_PLAT_IOS_DEVICE`
  14. = `BOOST_PLAT_IOS_SIMULATOR`
  15. [options="header"]
  16. |===
  17. | {predef_symbol} | {predef_version}
  18. | `TARGET_IPHONE_SIMULATOR` | {predef_detection}
  19. | `TARGET_OS_SIMULATOR` | {predef_detection}
  20. |===
  21. */ // end::reference[]
  22. #define BOOST_PLAT_IOS_DEVICE BOOST_VERSION_NUMBER_NOT_AVAILABLE
  23. #define BOOST_PLAT_IOS_SIMULATOR BOOST_VERSION_NUMBER_NOT_AVAILABLE
  24. // https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h
  25. #if BOOST_OS_IOS
  26. # include <TargetConditionals.h>
  27. # if defined(TARGET_OS_SIMULATOR) && (TARGET_OS_SIMULATOR == 1)
  28. # undef BOOST_PLAT_IOS_SIMULATOR
  29. # define BOOST_PLAT_IOS_SIMULATOR BOOST_VERSION_NUMBER_AVAILABLE
  30. # elif defined(TARGET_IPHONE_SIMULATOR) && (TARGET_IPHONE_SIMULATOR == 1)
  31. # undef BOOST_PLAT_IOS_SIMULATOR
  32. # define BOOST_PLAT_IOS_SIMULATOR BOOST_VERSION_NUMBER_AVAILABLE
  33. # else
  34. # undef BOOST_PLAT_IOS_DEVICE
  35. # define BOOST_PLAT_IOS_DEVICE BOOST_VERSION_NUMBER_AVAILABLE
  36. # endif
  37. #endif
  38. #if BOOST_PLAT_IOS_SIMULATOR
  39. # define BOOST_PLAT_IOS_SIMULATOR_AVAILABLE
  40. # include <boost/predef/detail/platform_detected.h>
  41. #endif
  42. #if BOOST_PLAT_IOS_DEVICE
  43. # define BOOST_PLAT_IOS_DEVICE_AVAILABLE
  44. # include <boost/predef/detail/platform_detected.h>
  45. #endif
  46. #define BOOST_PLAT_IOS_SIMULATOR_NAME "iOS Simulator"
  47. #define BOOST_PLAT_IOS_DEVICE_NAME "iOS Device"
  48. #endif // BOOST_PREDEF_PLAT_IOS_H
  49. #include <boost/predef/detail/test.h>
  50. BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_IOS_SIMULATOR,BOOST_PLAT_IOS_SIMULATOR_NAME)
  51. BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_IOS_DEVICE,BOOST_PLAT_IOS_DEVICE_NAME)