version.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /**
  2. * CoreFoundation Version Header
  3. *
  4. * by HASHBANG Productions <http://hbang.ws>
  5. * Public Domain
  6. *
  7. * 2.0 478.23
  8. * 2.1 478.26
  9. * 2.2 478.29
  10. * 3.0 478.47
  11. * 3.1 478.52
  12. * 3.2 478.61
  13. * 4.0 550.32
  14. * 4.1 550.38
  15. * 4.2 550.52
  16. * 4.3 550.58
  17. * 5.0 675.00
  18. * 5.1 690.10
  19. * 6.x 793.00
  20. * 7.0 847.20
  21. * 7.0.3 847.21
  22. * 7.1 847.26
  23. * 8.0 1140.10
  24. * 8.1 1141.14
  25. * 8.2 1142.16
  26. * 8.3 1144.17
  27. * 8.4 1145.15
  28. * 9.0 1240.1
  29. */
  30. /**
  31. * iOS 2.0 - 4.2 are defined in CoreFoundation/CFBase.h. The format prior to
  32. * 4.0 is kCFCoreFoundationVersionNumber_iPhoneOS_X_Y. 4.0 and newer have the
  33. * format kCFCoreFoundationVersionNumber_iOS_X_Y.
  34. */
  35. #import <CoreFoundation/CFBase.h>
  36. /**
  37. * The weird thing about those #defines is that some newer ones don't exist in
  38. * newer SDKs. Let's define version numbers all the way up to the latest.
  39. */
  40. #ifndef kCFCoreFoundationVersionNumber_iOS_4_3
  41. #define kCFCoreFoundationVersionNumber_iOS_4_3 550.58
  42. #endif
  43. #ifndef kCFCoreFoundationVersionNumber_iOS_5_0
  44. #define kCFCoreFoundationVersionNumber_iOS_5_0 675.00
  45. #endif
  46. #ifndef kCFCoreFoundationVersionNumber_iOS_5_1
  47. #define kCFCoreFoundationVersionNumber_iOS_5_1 690.10
  48. #endif
  49. #ifndef kCFCoreFoundationVersionNumber_iOS_6_0
  50. #define kCFCoreFoundationVersionNumber_iOS_6_0 793.00
  51. #endif
  52. #ifndef kCFCoreFoundationVersionNumber_iOS_6_1
  53. #define kCFCoreFoundationVersionNumber_iOS_6_1 793.00
  54. #endif
  55. #ifndef kCFCoreFoundationVersionNumber_iOS_7_0
  56. #define kCFCoreFoundationVersionNumber_iOS_7_0 847.20
  57. #endif
  58. #ifndef kCFCoreFoundationVersionNumber_iOS_7_0_3
  59. #define kCFCoreFoundationVersionNumber_iOS_7_0_3 847.21
  60. #endif
  61. #ifndef kCFCoreFoundationVersionNumber_iOS_7_1
  62. #define kCFCoreFoundationVersionNumber_iOS_7_1 847.26
  63. #endif
  64. #ifndef kCFCoreFoundationVersionNumber_iOS_8_0
  65. #define kCFCoreFoundationVersionNumber_iOS_8_0 1140.10
  66. #endif
  67. #ifndef kCFCoreFoundationVersionNumber_iOS_8_1
  68. #define kCFCoreFoundationVersionNumber_iOS_8_1 1141.14
  69. #endif
  70. #ifndef kCFCoreFoundationVersionNumber_iOS_8_2
  71. #define kCFCoreFoundationVersionNumber_iOS_8_2 1142.16
  72. #endif
  73. #ifndef kCFCoreFoundationVersionNumber_iOS_8_3
  74. #define kCFCoreFoundationVersionNumber_iOS_8_3 1144.17
  75. #endif
  76. #ifndef kCFCoreFoundationVersionNumber_iOS_8_4
  77. #define kCFCoreFoundationVersionNumber_iOS_8_4 1145.15
  78. #endif
  79. #ifndef kCFCoreFoundationVersionNumber_iOS_9_0
  80. #define kCFCoreFoundationVersionNumber_iOS_9_0 1240.1
  81. #endif
  82. #ifndef kCFCoreFoundationVersionNumber10_10
  83. #define kCFCoreFoundationVersionNumber10_10 1151.16
  84. #endif
  85. /**
  86. * Let's also define some useful functions to check which firmware the user is
  87. * on. (Note that feature detection is highly recommended where possible)
  88. */
  89. #define IS_IOS_OR_OLDER(version) (kCFCoreFoundationVersionNumber <= kCFCoreFoundationVersionNumber_##version)
  90. #define IS_IOS_OR_NEWER(version) (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_##version)
  91. #define IS_IOS_BETWEEN(start, end) (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_##start && kCFCoreFoundationVersionNumber <= kCFCoreFoundationVersionNumber_##end)
  92. /**
  93. * And let's make equivalent macros for OS X so it doesn't feel lonely.
  94. */
  95. #define IS_OSX_OR_OLDER (kCFCoreFoundationVersionNumber <= kCFCoreFoundationVersionNumber##version)
  96. #define IS_OSX_OR_NEWER(version) (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber##version)
  97. #define IS_OSX_BETWEEN(start, end) (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber##start && kCFCoreFoundationVersionNumber <= kCFCoreFoundationVersionNumber##end)