ios.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. /*`
  13. [heading `BOOST_PLAT_IOS_DEVICE`]
  14. [heading `BOOST_PLAT_IOS_SIMULATOR`]
  15. [table
  16. [[__predef_symbol__] [__predef_version__]]
  17. [[`TARGET_IPHONE_SIMULATOR`] [__predef_detection__]]
  18. [[`TARGET_OS_SIMULATOR`] [__predef_detection__]]
  19. ]
  20. */
  21. #define BOOST_PLAT_IOS_DEVICE BOOST_VERSION_NUMBER_NOT_AVAILABLE
  22. #define BOOST_PLAT_IOS_SIMULATOR BOOST_VERSION_NUMBER_NOT_AVAILABLE
  23. // https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h
  24. #if BOOST_OS_IOS
  25. # include <TargetConditionals.h>
  26. # if defined(TARGET_OS_SIMULATOR) && (TARGET_OS_SIMULATOR == 1)
  27. # undef BOOST_PLAT_IOS_SIMULATOR
  28. # define BOOST_PLAT_IOS_SIMULATOR BOOST_VERSION_NUMBER_AVAILABLE
  29. # elif defined(TARGET_IPHONE_SIMULATOR) && (TARGET_IPHONE_SIMULATOR == 1)
  30. # undef BOOST_PLAT_IOS_SIMULATOR
  31. # define BOOST_PLAT_IOS_SIMULATOR BOOST_VERSION_NUMBER_AVAILABLE
  32. # else
  33. # undef BOOST_PLAT_IOS_DEVICE
  34. # define BOOST_PLAT_IOS_DEVICE BOOST_VERSION_NUMBER_AVAILABLE
  35. # endif
  36. #endif
  37. #if BOOST_PLAT_IOS_SIMULATOR
  38. # define BOOST_PLAT_IOS_SIMULATOR_AVAILABLE
  39. # include <boost/predef/detail/platform_detected.h>
  40. #endif
  41. #if BOOST_PLAT_IOS_DEVICE
  42. # define BOOST_PLAT_IOS_DEVICE_AVAILABLE
  43. # include <boost/predef/detail/platform_detected.h>
  44. #endif
  45. #define BOOST_PLAT_IOS_SIMULATOR_NAME "iOS Simulator"
  46. #define BOOST_PLAT_IOS_DEVICE_NAME "iOS Device"
  47. #endif // BOOST_PREDEF_PLAT_IOS_H
  48. #include <boost/predef/detail/test.h>
  49. BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_IOS_SIMULATOR,BOOST_PLAT_IOS_SIMULATOR_NAME)
  50. BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_IOS_DEVICE,BOOST_PLAT_IOS_DEVICE_NAME)