説明なし
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

Preprocessor.h 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. #pragma once
  2. #include <Availability.h>
  3. #include <TargetConditionals.h>
  4. //------------------------------------------------------------------------------
  5. //
  6. // ensuring proper compiler/xcode/whatever selection
  7. //
  8. #ifndef __clang__
  9. #error Please use clang compiler.
  10. #endif
  11. #if __clang_major__ < 13
  12. #error Please use Xcode 13.0 or newer
  13. #endif
  14. #if !defined(__IPHONE_15_0) || __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_15_0
  15. #error Please use iOS SDK 15.0 or newer
  16. #endif
  17. #if defined(TARGET_OS_TV) && TARGET_OS_TV && !defined(__TVOS_15_0)
  18. #error Please use tvOS SDK 15.0 or newer
  19. #endif
  20. #if TARGET_OS_IOS && (!defined(__IPHONE_13_0) || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_13_0)
  21. #error Please target iOS 13.0 or newer
  22. #endif
  23. #if TARGET_OS_TV && (!defined(__TVOS_13_0) || __TV_OS_VERSION_MIN_REQUIRED < __TVOS_13_0)
  24. #error Please target tvOS 13.0 or newer
  25. #endif
  26. //------------------------------------------------------------------------------
  27. //
  28. // defines for target platform
  29. // Note: visionOS defines _OS_XR and _OS_IOS
  30. //
  31. #define UNITY_TRAMPOLINE_IN_USE 1
  32. // #define PLATFORM_* values are set by Build Program when Xcode project is generated (including "append") according to the selected platform.
  33. #define PLATFORM_IOS 1
  34. #define PLATFORM_OSX 0
  35. #define PLATFORM_TVOS 0
  36. #define PLATFORM_VISIONOS 0
  37. #if !(TARGET_OS_IOS || TARGET_OS_OSX || TARGET_OS_TV || TARGET_OS_VISION)
  38. #error one of TARGET_OS_IOS, TARGET_OS_OSX, TARGET_OS_TV, TARGET_OS_VISION should be defined
  39. #endif
  40. #if !(PLATFORM_IOS || PLATFORM_OSX || PLATFORM_TVOS || PLATFORM_VISIONOS)
  41. #error at least one of PLATFORM_IOS, PLATFORM_OSX, PLATFORM_TVOS, PLATFORM_VISIONOS must be defined
  42. #endif
  43. //------------------------------------------------------------------------------
  44. //
  45. // defines for sdk/target version
  46. //
  47. // It's hard to figure out which SDK we are using as the availability macros defined in the SDK
  48. // have various quirks.
  49. //
  50. // It's not possible to use *_VERSION_MAX_ALLOWED macros because they not always corresponded to
  51. // the SDK version. In particular, __TV_OS_VERSION_MAX_ALLOWED was out of sync in all Xcode dot
  52. // releases except the first so far.
  53. //
  54. // The highest __IPHONE_X_Y or __TVOS_X_Y macro that is defined in Availability.h correctly
  55. // corresponds to the version of the SDK (at least in each Xcode version since 6.0 up to 9.0).
  56. // However, some other headers (e.g. System/Library/Frameworks/QuartzCore.framework/Headers/CABase.h
  57. // in SDKs up to 9.3) may define the macros itself and this does not correspond to the what's in
  58. // Availability.h. Thus we make sure to include "Preprocessor.h" before the CABase.h header.
  59. #if defined(CABASE_H)
  60. #error "Please include Preprocessor.h before other includes"
  61. #endif
  62. #if defined(__IPHONE_10_0)
  63. #define UNITY_HAS_IOSSDK_10_0 1
  64. #else
  65. #define UNITY_HAS_IOSSDK_10_0 0
  66. #endif
  67. #if defined(__IPHONE_10_2)
  68. #define UNITY_HAS_IOSSDK_10_2 1
  69. #else
  70. #define UNITY_HAS_IOSSDK_10_2 0
  71. #endif
  72. #if defined(__IPHONE_10_3)
  73. #define UNITY_HAS_IOSSDK_10_3 1
  74. #else
  75. #define UNITY_HAS_IOSSDK_10_3 0
  76. #endif
  77. #if defined(__IPHONE_11_0)
  78. #define UNITY_HAS_IOSSDK_11_0 1
  79. #else
  80. #define UNITY_HAS_IOSSDK_11_0 0
  81. #endif
  82. #if defined(__IPHONE_11_1)
  83. #define UNITY_HAS_IOSSDK_11_1 1
  84. #else
  85. #define UNITY_HAS_IOSSDK_11_1 0
  86. #endif
  87. #if defined(__IPHONE_12_0)
  88. #define UNITY_HAS_IOSSDK_12_0 1
  89. #else
  90. #define UNITY_HAS_IOSSDK_12_0 0
  91. #endif
  92. #if defined(__IPHONE_13_0)
  93. #define UNITY_HAS_IOSSDK_13_0 1
  94. #else
  95. #define UNITY_HAS_IOSSDK_13_0 0
  96. #endif
  97. #if defined(__IPHONE_14_0)
  98. #define UNITY_HAS_IOSSDK_14_0 1
  99. #else
  100. #define UNITY_HAS_IOSSDK_14_0 0
  101. #endif
  102. #if defined(__IPHONE_15_0)
  103. #define UNITY_HAS_IOSSDK_15_0 1
  104. #else
  105. #define UNITY_HAS_IOSSDK_15_0 0
  106. #endif
  107. #if defined(__TVOS_10_0)
  108. #define UNITY_HAS_TVOSSDK_10_0 1
  109. #else
  110. #define UNITY_HAS_TVOSSDK_10_0 0
  111. #endif
  112. #if defined(__TVOS_10_2)
  113. #define UNITY_HAS_TVOSSDK_10_2 1
  114. #else
  115. #define UNITY_HAS_TVOSSDK_10_2 0
  116. #endif
  117. #if defined(__TVOS_11_0)
  118. #define UNITY_HAS_TVOSSDK_11_0 1
  119. #else
  120. #define UNITY_HAS_TVOSSDK_11_0 0
  121. #endif
  122. #if defined(__TVOS_12_0)
  123. #define UNITY_HAS_TVOSSDK_12_0 1
  124. #else
  125. #define UNITY_HAS_TVOSSDK_12_0 0
  126. #endif
  127. #if defined(__TVOS_13_0)
  128. #define UNITY_HAS_TVOSSDK_13_0 1
  129. #else
  130. #define UNITY_HAS_TVOSSDK_13_0 0
  131. #endif
  132. #if defined(__TVOS_14_0)
  133. #define UNITY_HAS_TVOSSDK_14_0 1
  134. #else
  135. #define UNITY_HAS_TVOSSDK_14_0 0
  136. #endif
  137. #if defined(__TVOS_15_0)
  138. #define UNITY_HAS_TVOSSDK_15_0 1
  139. #else
  140. #define UNITY_HAS_TVOSSDK_15_0 0
  141. #endif
  142. //------------------------------------------------------------------------------
  143. //
  144. // defines for used unity features
  145. //
  146. // The following UNITY_USES_* flags disable functionality in the trampoline project whenever the user does not use it from his scripts.
  147. // We detect the API usage and adjust the value of these flags whenever the project is built (including "append")
  148. #define UNITY_USES_REMOTE_NOTIFICATIONS 0
  149. #define UNITY_USES_WEBCAM 0
  150. #define UNITY_USES_MICROPHONE 0
  151. #define UNITY_USES_REPLAY_KIT 0
  152. #define UNITY_USES_DYNAMIC_PLAYER_LIB 0
  153. #define UNITY_USES_LOCATION 0
  154. #define UNITY_USES_GLES 0
  155. #define UNITY_USES_IAD 0
  156. //------------------------------------------------------------------------------
  157. //
  158. // defines for used features
  159. //
  160. #define UNITY_DEVELOPER_BUILD 0
  161. #define USE_IL2CPP_PCH 0
  162. #define UNITY_SNAPSHOT_VIEW_ON_APPLICATION_PAUSE 0
  163. // we now support metal always everywhere, but we keep the define for native plugins using it
  164. #define UNITY_CAN_USE_METAL 1
  165. #define UNITY_SUPPORT_ROTATION PLATFORM_IOS
  166. #if PLATFORM_TVOS
  167. #define UNITY_TVOS_ORIENTATION landscapeLeft
  168. #endif
  169. #if PLATFORM_VISIONOS
  170. #define UNITY_VISIONOS_ORIENTATION landscapeLeft
  171. #endif
  172. #if PLATFORM_IOS || PLATFORM_TVOS || PLATFORM_VISIONOS
  173. #define UNITY_REPLAY_KIT_AVAILABLE UNITY_USES_REPLAY_KIT
  174. #else
  175. #define UNITY_REPLAY_KIT_AVAILABLE 0
  176. #endif
  177. // On tvOS simulator we implement a fake remote as tvOS simulator does not support controllers (yet)
  178. #define UNITY_TVOS_SIMULATOR_FAKE_REMOTE (PLATFORM_TVOS && TARGET_OS_SIMULATOR)