ios.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 MSGPACK_PREDEF_PLAT_IOS_H
  9. #define MSGPACK_PREDEF_PLAT_IOS_H
  10. #include <msgpack/predef/os/ios.h> // MSGPACK_OS_IOS
  11. #include <msgpack/predef/version_number.h> // MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
  12. /*`
  13. [heading `MSGPACK_PLAT_IOS_DEVICE`]
  14. [heading `MSGPACK_PLAT_IOS_SIMULATOR`]
  15. [table
  16. [[__predef_symbol__] [__predef_version__]]
  17. [[`TARGET_IPHONE_SIMULATOR`] [__predef_detection__]]
  18. ]
  19. */
  20. #define MSGPACK_PLAT_IOS_DEVICE MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
  21. #define MSGPACK_PLAT_IOS_SIMULATOR MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
  22. // https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h
  23. #if MSGPACK_OS_IOS
  24. # include <TargetConditionals.h>
  25. # if TARGET_IPHONE_SIMULATOR == 1
  26. # undef MSGPACK_PLAT_IOS_SIMULATOR
  27. # define MSGPACK_PLAT_IOS_SIMULATOR MSGPACK_VERSION_NUMBER_AVAILABLE
  28. # else
  29. # undef MSGPACK_PLAT_IOS_DEVICE
  30. # define MSGPACK_PLAT_IOS_DEVICE MSGPACK_VERSION_NUMBER_AVAILABLE
  31. # endif
  32. #endif
  33. #if MSGPACK_PLAT_IOS_SIMULATOR
  34. # define MSGPACK_PLAT_IOS_SIMULATOR_AVAILABLE
  35. # include <msgpack/predef/detail/platform_detected.h>
  36. #endif
  37. #if MSGPACK_PLAT_IOS_DEVICE
  38. # define MSGPACK_PLAT_IOS_DEVICE_AVAILABLE
  39. # include <msgpack/predef/detail/platform_detected.h>
  40. #endif
  41. #define MSGPACK_PLAT_IOS_SIMULATOR_NAME "iOS Simulator"
  42. #define MSGPACK_PLAT_IOS_DEVICE_NAME "iOS Device"
  43. #endif // MSGPACK_PREDEF_PLAT_IOS_H
  44. #include <msgpack/predef/detail/test.h>
  45. MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_IOS_SIMULATOR,MSGPACK_PLAT_IOS_SIMULATOR_NAME)
  46. MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_IOS_DEVICE,MSGPACK_PLAT_IOS_DEVICE_NAME)