peachsim 0.1.1716 → 0.1.1738

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. package/README.md +21 -3
  2. package/cli/app-bundle-resources.ts +2 -1
  3. package/cli/app-fonts.ts +4 -4
  4. package/cli/app-splash.ts +4 -4
  5. package/cli/app-stubs.ts +17 -0
  6. package/cli/command-registry.ts +1 -0
  7. package/cli/commands/control.ts +83 -822
  8. package/cli/commands/coverage-swift.ts +112 -4
  9. package/cli/commands/daemon.ts +8 -0
  10. package/cli/commands/detox.ts +3 -0
  11. package/cli/commands/doctor.ts +19 -2
  12. package/cli/commands/inspect/actions.ts +74 -14
  13. package/cli/commands/inspect/core.ts +5 -1
  14. package/cli/commands/inspect/settling.ts +5 -2
  15. package/cli/commands/inspect/wait-ready.ts +6 -0
  16. package/cli/commands/inspect.ts +48 -45
  17. package/cli/commands/kotlin.ts +12 -2
  18. package/cli/commands/package.ts +760 -0
  19. package/cli/commands/serve.ts +6 -0
  20. package/cli/commands/shell-url.ts +838 -0
  21. package/cli/commands/swift.ts +42 -102
  22. package/cli/commands/test.ts +20 -0
  23. package/cli/commands/upload.ts +1 -1
  24. package/cli/device-option.ts +1 -1
  25. package/cli/main.ts +13 -1
  26. package/cli/native-input.ts +199 -0
  27. package/cli/outbound-endpoints.ts +26 -1
  28. package/cli/packaged-app-launcher.ts +95 -0
  29. package/cli/scene-video.ts +36 -12
  30. package/detox/index.ts +196 -24
  31. package/dist-lib/agent-daemon-client.cjs +1 -1
  32. package/dist-lib/agent-events.cjs +1 -1
  33. package/dist-lib/attached-projects.cjs +5 -2
  34. package/dist-lib/auth/shared-session.cjs +5 -2
  35. package/dist-lib/backend-origin.cjs +1 -1
  36. package/dist-lib/beta.cjs +1 -1
  37. package/dist-lib/beta.mjs +1 -1
  38. package/dist-lib/bridge-constants.cjs +1 -1
  39. package/dist-lib/bridge-contract-input.cjs +1 -1
  40. package/dist-lib/bridge-contract-input.mjs +1 -1
  41. package/dist-lib/bridge-contract.cjs +1 -1
  42. package/dist-lib/bridge-contract.mjs +1 -1
  43. package/dist-lib/bundle-channel.cjs +39889 -31873
  44. package/dist-lib/capture-contract.cjs +1 -1
  45. package/dist-lib/capture-contract.mjs +1 -1
  46. package/dist-lib/cloud-contract.cjs +1 -1
  47. package/dist-lib/cloud-contract.mjs +1 -1
  48. package/dist-lib/cloud-test-args.cjs +1 -1
  49. package/dist-lib/cloud-test-args.mjs +1 -1
  50. package/dist-lib/cloud.cjs +1 -1
  51. package/dist-lib/cloud.mjs +1 -1
  52. package/dist-lib/config.cjs +1 -1
  53. package/dist-lib/config.mjs +1 -1
  54. package/dist-lib/detox/index.cjs +195 -63
  55. package/dist-lib/dev-bundle-resolution.cjs +14 -13
  56. package/dist-lib/expo-swift-bundle.cjs +18507 -11835
  57. package/dist-lib/expo-swift-metadata.cjs +4 -1
  58. package/dist-lib/expo-swift-metadata.mjs +3 -1
  59. package/dist-lib/home-paths.cjs +27 -3
  60. package/dist-lib/host/bridge-host.cjs +28373 -24090
  61. package/dist-lib/host/fetch-proxy-handler.cjs +235 -225
  62. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  63. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  64. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  65. package/dist-lib/host/websocket-proxy.cjs +1 -1
  66. package/dist-lib/index.cjs +915 -399
  67. package/dist-lib/jump-to-source-babel.cjs +1 -1
  68. package/dist-lib/jump-to-source-native.cjs +1 -1
  69. package/dist-lib/kotlin-host.cjs +335 -47
  70. package/dist-lib/menu.cjs +13 -1
  71. package/dist-lib/menu.mjs +13 -1
  72. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  73. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  74. package/dist-lib/metro-production-bundle.cjs +1 -1
  75. package/dist-lib/metro-production-bundle.mjs +1 -1
  76. package/dist-lib/metro.cjs +918 -411
  77. package/dist-lib/native-app-identity-project.cjs +703 -283
  78. package/dist-lib/native-app-identity-project.mjs +500 -87
  79. package/dist-lib/native-app-identity.cjs +13 -2
  80. package/dist-lib/native-app-identity.mjs +13 -2
  81. package/dist-lib/native-firebase-metadata.cjs +1 -1
  82. package/dist-lib/native-firebase-metadata.mjs +1 -1
  83. package/dist-lib/plist.cjs +1 -1
  84. package/dist-lib/plist.mjs +1 -1
  85. package/dist-lib/profiles.cjs +5 -2
  86. package/dist-lib/public-brand.cjs +1 -1
  87. package/dist-lib/public-origins-lib-esm.json +28 -23
  88. package/dist-lib/public-origins-lib.json +418 -224
  89. package/dist-lib/react-native-host-modules.cjs +35 -2
  90. package/dist-lib/react-native-host-modules.mjs +35 -2
  91. package/dist-lib/reap-browser.cjs +12 -4
  92. package/dist-lib/scripts/dev-server-scanner.cjs +15 -8
  93. package/dist-lib/sdk.cjs +17 -7
  94. package/dist-lib/sdk.mjs +16 -7
  95. package/dist-lib/skills.cjs +44825 -29141
  96. package/dist-lib/swift-compile.cjs +616 -400
  97. package/dist-lib/swift-compile.mjs +528 -315
  98. package/dist-lib/swift-package.cjs +1 -1
  99. package/dist-lib/swift-package.mjs +1 -1
  100. package/dist-lib/swift-submit.cjs +2 -2
  101. package/dist-lib/swift-submit.mjs +2 -2
  102. package/dist-lib/swift-toolchain.cjs +105 -17
  103. package/dist-lib/swift.cjs +1 -1
  104. package/dist-lib/vite-swift.cjs +4660 -2252
  105. package/dist-lib/vite.cjs +248 -234
  106. package/dist-lib/worklet-executable.cjs +1 -1
  107. package/dist-lib/worklet-executable.mjs +1 -1
  108. package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +17 -8
  109. package/dist-types/packages/peach-engine/src/engine/canvaskit-renderer.d.ts +1 -0
  110. package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +7 -4
  111. package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +9 -6
  112. package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +0 -5
  113. package/dist-types/packages/peach-engine/src/engine/memory-counts.d.ts +11 -1
  114. package/dist-types/packages/peach-engine/src/engine/node.d.ts +5 -12
  115. package/dist-types/packages/peach-engine/src/engine/render-damage.d.ts +2 -2
  116. package/dist-types/packages/peach-engine/src/engine/text-first-baseline.d.ts +5 -0
  117. package/dist-types/packages/peach-engine/src/engine/text-paragraph.d.ts +1 -0
  118. package/dist-types/packages/peach-engine/src/engine/types.d.ts +3 -0
  119. package/dist-types/packages/peach-engine/src/native-preview-bundle.d.ts +2 -0
  120. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +9 -0
  121. package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +3 -0
  122. package/dist-types/packages/peach-engine/src/render-worker/native-ui-commandContract.d.ts +1 -1
  123. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +7 -2
  124. package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +5 -0
  125. package/dist-types/packages/peach-engine/src/render-worker/tree-sync-port.d.ts +1 -1
  126. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +36 -2
  127. package/dist-types/packages/peach-engine/src/shell-events.d.ts +1 -0
  128. package/dist-types/packages/peach-globals/src/audioBridgeContract.d.ts +5 -0
  129. package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
  130. package/dist-types/packages/peach-globals/src/keyboardBridgeContract.d.ts +11 -0
  131. package/dist-types/packages/peach-globals/src/shellBridgeContract.d.ts +1 -0
  132. package/dist-types/packages/peach-globals/src/testBridgeContract.d.ts +9 -2
  133. package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
  134. package/kotlin/README.md +3 -0
  135. package/kotlin/sdk.tar.gz +0 -0
  136. package/package.json +1 -1
  137. package/runtime-companion.json +1 -1
  138. package/scripts/dev-server-scanner.ts +12 -25
  139. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccount.h +55 -0
  140. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountCredential.h +35 -0
  141. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountStore.h +94 -0
  142. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountType.h +53 -0
  143. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACError.h +37 -0
  144. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/Accounts.h +13 -0
  145. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/AccountsDefines.h +13 -0
  146. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Modules/module.modulemap +5 -0
  147. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASFoundation.h +52 -0
  148. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASWebAuthenticationSession.h +128 -0
  149. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASWebAuthenticationSessionCallback.h +35 -0
  150. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/AuthenticationServices.h +3 -0
  151. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Modules/module.modulemap +5 -0
  152. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPMessage.h +724 -0
  153. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h +4 -0
  154. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkDefs.h +27 -0
  155. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Modules/module.modulemap +5 -0
  156. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h +1301 -0
  157. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +3 -1
  158. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager.h +21 -50
  159. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLRegion.h +6 -6
  160. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes +58 -3
  161. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +711 -46
  162. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h +12 -0
  163. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIInterface.h +23 -0
  164. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +7 -9
  165. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIOrientation.h +14 -0
  166. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIStringDrawing.h +12 -0
  167. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIView.h +14 -0
  168. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewAnimating.h +12 -0
  169. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h +16 -0
  170. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIWindow.h +2 -0
  171. package/sdk/ios/usr/include/ConditionalMacros.h +619 -0
  172. package/sdk/ios/usr/include/module.modulemap +1 -0
  173. package/sdk/ios/usr/include/objc/objc-sync.h +59 -0
  174. package/sdk/ios/usr/include/os/signpost.h +414 -0
  175. package/sdk/ios/usr/include/os.modulemap +10 -0
  176. package/sdk/ios/usr/include/sys/cdefs.h +5 -0
  177. package/sdk/ios/usr/include/sys/ioccom.h +99 -0
  178. package/sdk/ios/usr/include/sys/syslog.h +236 -0
  179. package/sdk/ios/usr/include/syslog.h +24 -0
  180. package/sdk/ios/wasm/include/errno.h +4 -20
  181. package/sdk/ios/wasm/include/fcntl.h +4 -2
  182. package/sdk/ios/wasm/include/pthread.h +3 -0
  183. package/sdk/ios/wasm/include/setjmp.h +57 -0
  184. package/sdk/ios/wasm/include/stdio.h +24 -0
  185. package/sdk/ios/wasm/include/stdlib.h +32 -7
  186. package/sdk/ios/wasm/include/sys/file.h +7 -0
  187. package/sdk/ios/wasm/include/sys/ioctl.h +6 -0
  188. package/sdk/ios/wasm/include/sys/resource.h +2 -2
  189. package/sdk/ios/wasm/include/sys/syscall.h +9 -0
  190. package/sdk/ios/wasm/include/sys/time.h +10 -0
  191. package/sdk/ios/wasm/include/unistd.h +12 -3
  192. package/sdk/native-hashes.json +4 -3
  193. package/skills/contrast/SKILL.md +2 -1
  194. package/skills/peach-debug/SKILL.md +0 -1
  195. package/skills/peach-perf/SKILL.md +0 -1
  196. package/skills/peach-setup/SKILL.md +0 -1
  197. package/skills/peach-test/SKILL.md +7 -4
  198. package/skills/peach-visual/SKILL.md +0 -1
  199. package/src/admitted-mac-build.ts +3 -0
  200. package/src/android-app-identity.ts +18 -0
  201. package/src/android-autolinking.ts +1 -0
  202. package/src/android-bridge-packages.ts +279 -0
  203. package/src/android-root-module.ts +9 -9
  204. package/src/appPackageContract.ts +83 -0
  205. package/src/bridge-contract.ts +50 -0
  206. package/src/bundle-channel.mjs +41 -6
  207. package/src/cli-runtime.ts +9 -5
  208. package/src/dev-bundle-resolution.ts +7 -27
  209. package/src/dom-source-reference.ts +15 -0
  210. package/src/expo-discovery-cache.ts +134 -26
  211. package/src/expo-kotlin-host.ts +97 -26
  212. package/src/expo-manifest-body.ts +33 -0
  213. package/src/expo-native-workspace.ts +158 -38
  214. package/src/expo-swift-host.ts +350 -75
  215. package/src/expo-swift-ready.ts +5 -1
  216. package/src/expoKotlinContract.ts +12 -2
  217. package/src/expoSwiftContract.ts +10 -0
  218. package/src/generated/swift-c-predefines.json +1 -1
  219. package/src/home-paths.ts +41 -2
  220. package/src/host/app-package-handler.ts +47 -0
  221. package/src/host/bridge-host.ts +8 -0
  222. package/src/host/fetch-proxy-handler.ts +10 -0
  223. package/src/host/staged-host-files.ts +18 -0
  224. package/src/index.ts +3 -0
  225. package/src/kotlin-host.ts +225 -48
  226. package/src/kotlin-instance-source.ts +126 -0
  227. package/src/kotlinSdkContract.ts +2 -1
  228. package/src/menu.ts +14 -0
  229. package/src/native-app-identity-project.ts +7 -2
  230. package/src/native-app-identity.ts +11 -0
  231. package/src/native-firebase-config.ts +24 -1
  232. package/src/native-prebuilt.ts +154 -0
  233. package/src/nitro-adapter.lock.json +270 -270
  234. package/src/nitro-adapter.ts +56 -50
  235. package/src/nitro-bundle.ts +92 -74
  236. package/src/nitro-compile.ts +45 -14
  237. package/src/nitro-dependencies.ts +63 -46
  238. package/src/nitro-source.ts +64 -26
  239. package/src/nitroAdapterContract.ts +146 -98
  240. package/src/nitroContract.ts +71 -21
  241. package/src/react-native-bridge-modules.ts +70 -42
  242. package/src/react-native-host-modules.ts +34 -1
  243. package/src/reactNativeConfigurationContract.ts +14 -0
  244. package/src/reap-browser.ts +15 -3
  245. package/src/sdk.ts +5 -0
  246. package/src/settingsContract.ts +38 -1
  247. package/src/sim-client.ts +4 -1
  248. package/src/storageSnapshotContract.ts +32 -81
  249. package/src/swift-compile.ts +268 -89
  250. package/src/swift-coverage/indexdump.ts +22 -6
  251. package/src/swift-coverage/indexing.ts +4 -4
  252. package/src/swift-coverage/provenance.ts +1 -0
  253. package/src/swift-coverage/sdk.ts +104 -20
  254. package/src/swift-coverage/types.ts +34 -0
  255. package/src/swift-coverage/xcode-asset-symbols.ts +922 -0
  256. package/src/swift-coverage/xcode-assets.ts +89 -131
  257. package/src/swift-coverage/xcode.ts +10 -2
  258. package/src/swift-cxx-reachable.ts +2 -1
  259. package/src/swift-distribution.lock.json +20 -16
  260. package/src/swift-host.ts +98 -22
  261. package/src/swift-icu.ts +1 -1
  262. package/src/swift-link-roots.ts +118 -0
  263. package/src/swift-objc-compile.ts +144 -22
  264. package/src/swift-objc-import.ts +6 -0
  265. package/src/swift-objc-standin.ts +2 -14
  266. package/src/swift-package-manifest.ts +14 -6
  267. package/src/swift-packages.ts +75 -11
  268. package/src/swift-pdf-raster.ts +1 -0
  269. package/src/swift-root-lock.ts +17 -1
  270. package/src/swift-source-pods.ts +2 -10
  271. package/src/swift-standin-emit.ts +597 -57
  272. package/src/swift-standins.ts +599 -56
  273. package/src/swift-submit.ts +7 -1
  274. package/src/swift-toolchain.ts +140 -17
  275. package/src/turbo-bundle.ts +81 -0
  276. package/src/turbo-codegen-intake.ts +91 -0
  277. package/src/turbo-compile.ts +120 -0
  278. package/src/turbo-runtime.lock.json +69 -0
  279. package/src/turbo-source.ts +754 -0
  280. package/src/vite-plugin-one.ts +17 -12
  281. package/src/vite-plugin.ts +28 -15
  282. package/src/xcode-project.ts +223 -22
@@ -0,0 +1,619 @@
1
+ /*
2
+ * Copyright (c) 1993-2011 by Apple Inc.. All rights reserved.
3
+ *
4
+ * @APPLE_LICENSE_HEADER_START@
5
+ *
6
+ * This file contains Original Code and/or Modifications of Original Code
7
+ * as defined in and that are subject to the Apple Public Source License
8
+ * Version 2.0 (the 'License'). You may not use this file except in
9
+ * compliance with the License. Please obtain a copy of the License at
10
+ * http://www.opensource.apple.com/apsl/ and read it before using this
11
+ * file.
12
+ *
13
+ * The Original Code and all software distributed under the License are
14
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18
+ * Please see the License for the specific language governing rights and
19
+ * limitations under the License.
20
+ *
21
+ * @APPLE_LICENSE_HEADER_END@
22
+ */
23
+
24
+ /*
25
+ File: ConditionalMacros.h
26
+
27
+ Contains: Set up for compiler independent conditionals
28
+
29
+ Version: CarbonCore-769~1
30
+
31
+ Bugs?: For bug reports, consult the following page on
32
+ the World Wide Web:
33
+
34
+ http://developer.apple.com/bugreporter/
35
+
36
+ */
37
+ #ifndef __CONDITIONALMACROS__
38
+ #define __CONDITIONALMACROS__
39
+
40
+ #include <Availability.h>
41
+ /****************************************************************************************************
42
+ UNIVERSAL_INTERFACES_VERSION
43
+
44
+ 0x0400 --> version 4.0 (Mac OS X only)
45
+ 0x0335 --> version 3.4
46
+ 0x0331 --> version 3.3.1
47
+ 0x0330 --> version 3.3
48
+ 0x0320 --> version 3.2
49
+ 0x0310 --> version 3.1
50
+ 0x0301 --> version 3.0.1
51
+ 0x0300 --> version 3.0
52
+ 0x0210 --> version 2.1
53
+ This conditional did not exist prior to version 2.1
54
+ ****************************************************************************************************/
55
+ #define UNIVERSAL_INTERFACES_VERSION 0x0400
56
+ /****************************************************************************************************
57
+
58
+ All TARGET_* condtionals are set up by TargetConditionals.h
59
+
60
+ ****************************************************************************************************/
61
+ #include <TargetConditionals.h>
62
+
63
+
64
+
65
+
66
+ /****************************************************************************************************
67
+
68
+ PRAGMA_*
69
+ These conditionals specify whether the compiler supports particular #pragma's
70
+
71
+ PRAGMA_IMPORT - Compiler supports: #pragma import on/off/reset
72
+ PRAGMA_ONCE - Compiler supports: #pragma once
73
+ PRAGMA_STRUCT_ALIGN - Compiler supports: #pragma options align=mac68k/power/reset
74
+ PRAGMA_STRUCT_PACK - Compiler supports: #pragma pack(n)
75
+ PRAGMA_STRUCT_PACKPUSH - Compiler supports: #pragma pack(push, n)/pack(pop)
76
+ PRAGMA_ENUM_PACK - Compiler supports: #pragma options(!pack_enums)
77
+ PRAGMA_ENUM_ALWAYSINT - Compiler supports: #pragma enumsalwaysint on/off/reset
78
+ PRAGMA_ENUM_OPTIONS - Compiler supports: #pragma options enum=int/small/reset
79
+
80
+
81
+ FOUR_CHAR_CODE
82
+ This conditional is deprecated. It was used to work around a bug in one obscure compiler that did not pack multiple characters in single quotes rationally.
83
+ It was never intended for endian swapping.
84
+
85
+ FOUR_CHAR_CODE('abcd') - Convert a four-char-code to the correct 32-bit value
86
+
87
+
88
+ TYPE_*
89
+ These conditionals specify whether the compiler supports particular types.
90
+
91
+ TYPE_LONGLONG - Compiler supports "long long" 64-bit integers
92
+ TYPE_EXTENDED - Compiler supports "extended" 80/96 bit floating point
93
+ TYPE_LONGDOUBLE_IS_DOUBLE - Compiler implements "long double" same as "double"
94
+
95
+
96
+ FUNCTION_*
97
+ These conditionals specify whether the compiler supports particular language extensions
98
+ to function prototypes and definitions.
99
+
100
+ FUNCTION_PASCAL - Compiler supports "pascal void Foo()"
101
+ FUNCTION_DECLSPEC - Compiler supports "__declspec(xxx) void Foo()"
102
+ FUNCTION_WIN32CC - Compiler supports "void __cdecl Foo()" and "void __stdcall Foo()"
103
+
104
+ ****************************************************************************************************/
105
+
106
+ #if defined(__GNUC__) && (defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__NEXT_CPP__) || defined(__MACOS_CLASSIC__))
107
+ /*
108
+ gcc based compilers used on Mac OS X
109
+ */
110
+ #define PRAGMA_IMPORT 0
111
+ #define PRAGMA_ONCE 0
112
+
113
+ #if __GNUC__ >= 4
114
+ #define PRAGMA_STRUCT_PACK 1
115
+ #define PRAGMA_STRUCT_PACKPUSH 1
116
+ #else
117
+ #define PRAGMA_STRUCT_PACK 0
118
+ #define PRAGMA_STRUCT_PACKPUSH 0
119
+ #endif
120
+
121
+ #if __LP64__ || __arm64__ || __ARM_ARCH_7K
122
+ #define PRAGMA_STRUCT_ALIGN 0
123
+ #else
124
+ #define PRAGMA_STRUCT_ALIGN 1
125
+ #endif
126
+
127
+ #define PRAGMA_ENUM_PACK 0
128
+ #define PRAGMA_ENUM_ALWAYSINT 0
129
+ #define PRAGMA_ENUM_OPTIONS 0
130
+ #define FOUR_CHAR_CODE(x) (x)
131
+
132
+ #define TYPE_EXTENDED 0
133
+
134
+ #ifdef __ppc__
135
+ #ifdef __LONG_DOUBLE_128__
136
+ #define TYPE_LONGDOUBLE_IS_DOUBLE 0
137
+ #else
138
+ #define TYPE_LONGDOUBLE_IS_DOUBLE 1
139
+ #endif
140
+ #else
141
+ #define TYPE_LONGDOUBLE_IS_DOUBLE 0
142
+ #endif
143
+
144
+ #define TYPE_LONGLONG 1
145
+
146
+ #define FUNCTION_PASCAL 0
147
+ #define FUNCTION_DECLSPEC 0
148
+ #define FUNCTION_WIN32CC 0
149
+
150
+ #ifdef __MACOS_CLASSIC__
151
+ #ifndef TARGET_API_MAC_CARBON /* gcc cfm cross compiler assumes you're building Carbon code */
152
+ #define TARGET_API_MAC_CARBON 1
153
+ #endif
154
+ #endif
155
+
156
+
157
+
158
+ #elif defined(__MWERKS__)
159
+ /*
160
+ CodeWarrior compiler from Metrowerks/Motorola
161
+ */
162
+ #define PRAGMA_ONCE 1
163
+ #define PRAGMA_IMPORT 0
164
+ #define PRAGMA_STRUCT_ALIGN 1
165
+ #define PRAGMA_STRUCT_PACK 1
166
+ #define PRAGMA_STRUCT_PACKPUSH 0
167
+ #define PRAGMA_ENUM_PACK 0
168
+ #define PRAGMA_ENUM_ALWAYSINT 1
169
+ #define PRAGMA_ENUM_OPTIONS 0
170
+ #if __option(enumsalwaysint) && __option(ANSI_strict)
171
+ #define FOUR_CHAR_CODE(x) ((long)(x)) /* otherwise compiler will complain about values with high bit set */
172
+ #else
173
+ #define FOUR_CHAR_CODE(x) (x)
174
+ #endif
175
+ #define FUNCTION_PASCAL 1
176
+ #define FUNCTION_DECLSPEC 1
177
+ #define FUNCTION_WIN32CC 0
178
+
179
+ #if __option(longlong)
180
+ #define TYPE_LONGLONG 1
181
+ #else
182
+ #define TYPE_LONGLONG 0
183
+ #endif
184
+ #define TYPE_EXTENDED 0
185
+ #define TYPE_LONGDOUBLE_IS_DOUBLE 1
186
+
187
+
188
+
189
+ #else
190
+ /*
191
+ Unknown compiler, perhaps set up from the command line
192
+ */
193
+ #error unknown compiler
194
+ #ifndef PRAGMA_IMPORT
195
+ #define PRAGMA_IMPORT 0
196
+ #endif
197
+ #ifndef PRAGMA_STRUCT_ALIGN
198
+ #define PRAGMA_STRUCT_ALIGN 0
199
+ #endif
200
+ #ifndef PRAGMA_ONCE
201
+ #define PRAGMA_ONCE 0
202
+ #endif
203
+ #ifndef PRAGMA_STRUCT_PACK
204
+ #define PRAGMA_STRUCT_PACK 0
205
+ #endif
206
+ #ifndef PRAGMA_STRUCT_PACKPUSH
207
+ #define PRAGMA_STRUCT_PACKPUSH 0
208
+ #endif
209
+ #ifndef PRAGMA_ENUM_PACK
210
+ #define PRAGMA_ENUM_PACK 0
211
+ #endif
212
+ #ifndef PRAGMA_ENUM_ALWAYSINT
213
+ #define PRAGMA_ENUM_ALWAYSINT 0
214
+ #endif
215
+ #ifndef PRAGMA_ENUM_OPTIONS
216
+ #define PRAGMA_ENUM_OPTIONS 0
217
+ #endif
218
+ #ifndef FOUR_CHAR_CODE
219
+ #define FOUR_CHAR_CODE(x) (x)
220
+ #endif
221
+
222
+ #ifndef TYPE_LONGDOUBLE_IS_DOUBLE
223
+ #define TYPE_LONGDOUBLE_IS_DOUBLE 1
224
+ #endif
225
+ #ifndef TYPE_EXTENDED
226
+ #define TYPE_EXTENDED 0
227
+ #endif
228
+ #ifndef TYPE_LONGLONG
229
+ #define TYPE_LONGLONG 0
230
+ #endif
231
+ #ifndef FUNCTION_PASCAL
232
+ #define FUNCTION_PASCAL 0
233
+ #endif
234
+ #ifndef FUNCTION_DECLSPEC
235
+ #define FUNCTION_DECLSPEC 0
236
+ #endif
237
+ #ifndef FUNCTION_WIN32CC
238
+ #define FUNCTION_WIN32CC 0
239
+ #endif
240
+ #endif
241
+
242
+
243
+
244
+
245
+ /****************************************************************************************************
246
+
247
+ Under MacOS, the classic 68k runtime has two calling conventions: pascal or C
248
+ Under Win32, there are two calling conventions: __cdecl or __stdcall
249
+ Headers and implementation files can use the following macros to make their
250
+ source more portable by hiding the calling convention details:
251
+
252
+ EXTERN_API*
253
+ These macros are used to specify the calling convention on a function prototype.
254
+
255
+ EXTERN_API - Classic 68k: pascal, Win32: __cdecl
256
+ EXTERN_API_C - Classic 68k: C, Win32: __cdecl
257
+ EXTERN_API_STDCALL - Classic 68k: pascal, Win32: __stdcall
258
+ EXTERN_API_C_STDCALL - Classic 68k: C, Win32: __stdcall
259
+
260
+
261
+ DEFINE_API*
262
+ These macros are used to specify the calling convention on a function definition.
263
+
264
+ DEFINE_API - Classic 68k: pascal, Win32: __cdecl
265
+ DEFINE_API_C - Classic 68k: C, Win32: __cdecl
266
+ DEFINE_API_STDCALL - Classic 68k: pascal, Win32: __stdcall
267
+ DEFINE_API_C_STDCALL - Classic 68k: C, Win32: __stdcall
268
+
269
+
270
+ CALLBACK_API*
271
+ These macros are used to specify the calling convention of a function pointer.
272
+
273
+ CALLBACK_API - Classic 68k: pascal, Win32: __stdcall
274
+ CALLBACK_API_C - Classic 68k: C, Win32: __stdcall
275
+ CALLBACK_API_STDCALL - Classic 68k: pascal, Win32: __cdecl
276
+ CALLBACK_API_C_STDCALL - Classic 68k: C, Win32: __cdecl
277
+
278
+ ****************************************************************************************************/
279
+
280
+ #if FUNCTION_PASCAL && !FUNCTION_DECLSPEC && !FUNCTION_WIN32CC
281
+ /* compiler supports pascal keyword only */
282
+ #define EXTERN_API(_type) extern pascal _type
283
+ #define EXTERN_API_C(_type) extern _type
284
+ #define EXTERN_API_STDCALL(_type) extern pascal _type
285
+ #define EXTERN_API_C_STDCALL(_type) extern _type
286
+
287
+ #define DEFINE_API(_type) pascal _type
288
+ #define DEFINE_API_C(_type) _type
289
+ #define DEFINE_API_STDCALL(_type) pascal _type
290
+ #define DEFINE_API_C_STDCALL(_type) _type
291
+
292
+ #define CALLBACK_API(_type, _name) pascal _type (*_name)
293
+ #define CALLBACK_API_C(_type, _name) _type (*_name)
294
+ #define CALLBACK_API_STDCALL(_type, _name) pascal _type (*_name)
295
+ #define CALLBACK_API_C_STDCALL(_type, _name) _type (*_name)
296
+
297
+ #elif FUNCTION_PASCAL && FUNCTION_DECLSPEC && !FUNCTION_WIN32CC
298
+ /* compiler supports pascal and __declspec() */
299
+ #define EXTERN_API(_type) extern pascal __declspec(dllimport) _type
300
+ #define EXTERN_API_C(_type) extern __declspec(dllimport) _type
301
+ #define EXTERN_API_STDCALL(_type) extern pascal __declspec(dllimport) _type
302
+ #define EXTERN_API_C_STDCALL(_type) extern __declspec(dllimport) _type
303
+
304
+ #define DEFINE_API(_type) pascal __declspec(dllexport) _type
305
+ #define DEFINE_API_C(_type) __declspec(dllexport) _type
306
+ #define DEFINE_API_STDCALL(_type) pascal __declspec(dllexport) _type
307
+ #define DEFINE_API_C_STDCALL(_type) __declspec(dllexport) _type
308
+
309
+ #define CALLBACK_API(_type, _name) pascal _type (*_name)
310
+ #define CALLBACK_API_C(_type, _name) _type (*_name)
311
+ #define CALLBACK_API_STDCALL(_type, _name) pascal _type (*_name)
312
+ #define CALLBACK_API_C_STDCALL(_type, _name) _type (*_name)
313
+
314
+ #elif !FUNCTION_PASCAL && FUNCTION_DECLSPEC && !FUNCTION_WIN32CC
315
+ /* compiler supports __declspec() */
316
+ #define EXTERN_API(_type) extern __declspec(dllimport) _type
317
+ #define EXTERN_API_C(_type) extern __declspec(dllimport) _type
318
+ #define EXTERN_API_STDCALL(_type) extern __declspec(dllimport) _type
319
+ #define EXTERN_API_C_STDCALL(_type) extern __declspec(dllimport) _type
320
+
321
+ #define DEFINE_API(_type) __declspec(dllexport) _type
322
+ #define DEFINE_API_C(_type) __declspec(dllexport) _type
323
+ #define DEFINE_API_STDCALL(_type) __declspec(dllexport) _type
324
+ #define DEFINE_API_C_STDCALL(_type) __declspec(dllexport) _type
325
+
326
+ #define CALLBACK_API(_type, _name) _type ( * _name)
327
+ #define CALLBACK_API_C(_type, _name) _type ( * _name)
328
+ #define CALLBACK_API_STDCALL(_type, _name) _type ( * _name)
329
+ #define CALLBACK_API_C_STDCALL(_type, _name) _type ( * _name)
330
+
331
+ #elif !FUNCTION_PASCAL && FUNCTION_DECLSPEC && FUNCTION_WIN32CC
332
+ /* compiler supports __declspec() and __cdecl */
333
+ #define EXTERN_API(_type) __declspec(dllimport) _type __cdecl
334
+ #define EXTERN_API_C(_type) __declspec(dllimport) _type __cdecl
335
+ #define EXTERN_API_STDCALL(_type) __declspec(dllimport) _type __stdcall
336
+ #define EXTERN_API_C_STDCALL(_type) __declspec(dllimport) _type __stdcall
337
+
338
+ #define DEFINE_API(_type) __declspec(dllexport) _type __cdecl
339
+ #define DEFINE_API_C(_type) __declspec(dllexport) _type __cdecl
340
+ #define DEFINE_API_STDCALL(_type) __declspec(dllexport) _type __stdcall
341
+ #define DEFINE_API_C_STDCALL(_type) __declspec(dllexport) _type __stdcall
342
+
343
+ #define CALLBACK_API(_type, _name) _type (__cdecl * _name)
344
+ #define CALLBACK_API_C(_type, _name) _type (__cdecl * _name)
345
+ #define CALLBACK_API_STDCALL(_type, _name) _type (__stdcall * _name)
346
+ #define CALLBACK_API_C_STDCALL(_type, _name) _type (__stdcall * _name)
347
+
348
+ #elif !FUNCTION_PASCAL && !FUNCTION_DECLSPEC && FUNCTION_WIN32CC
349
+ /* compiler supports __cdecl */
350
+ #define EXTERN_API(_type) _type __cdecl
351
+ #define EXTERN_API_C(_type) _type __cdecl
352
+ #define EXTERN_API_STDCALL(_type) _type __stdcall
353
+ #define EXTERN_API_C_STDCALL(_type) _type __stdcall
354
+
355
+ #define DEFINE_API(_type) _type __cdecl
356
+ #define DEFINE_API_C(_type) _type __cdecl
357
+ #define DEFINE_API_STDCALL(_type) _type __stdcall
358
+ #define DEFINE_API_C_STDCALL(_type) _type __stdcall
359
+
360
+ #define CALLBACK_API(_type, _name) _type (__cdecl * _name)
361
+ #define CALLBACK_API_C(_type, _name) _type (__cdecl * _name)
362
+ #define CALLBACK_API_STDCALL(_type, _name) _type (__stdcall * _name)
363
+ #define CALLBACK_API_C_STDCALL(_type, _name) _type (__stdcall * _name)
364
+
365
+ #else
366
+ /* compiler supports no extensions */
367
+ #define EXTERN_API(_type) extern _type
368
+ #define EXTERN_API_C(_type) extern _type
369
+ #define EXTERN_API_STDCALL(_type) extern _type
370
+ #define EXTERN_API_C_STDCALL(_type) extern _type
371
+
372
+ #define DEFINE_API(_type) _type
373
+ #define DEFINE_API_C(_type) _type
374
+ #define DEFINE_API_STDCALL(_type) _type
375
+ #define DEFINE_API_C_STDCALL(_type) _type
376
+
377
+ #define CALLBACK_API(_type, _name) _type ( * _name)
378
+ #define CALLBACK_API_C(_type, _name) _type ( * _name)
379
+ #define CALLBACK_API_STDCALL(_type, _name) _type ( * _name)
380
+ #define CALLBACK_API_C_STDCALL(_type, _name) _type ( * _name)
381
+ #undef pascal
382
+ #define pascal
383
+ #endif
384
+
385
+ /****************************************************************************************************
386
+
387
+ Set up TARGET_API_*_* values
388
+
389
+ ****************************************************************************************************/
390
+ #if !defined(TARGET_API_MAC_OS8) && !defined(TARGET_API_MAC_OSX) && !defined(TARGET_API_MAC_CARBON)
391
+ /* No TARGET_API_MAC_* predefined on command line */
392
+ #if TARGET_RT_MAC_MACHO
393
+ /* Looks like MachO style compiler */
394
+ #define TARGET_API_MAC_OS8 0
395
+ #define TARGET_API_MAC_CARBON 1
396
+ #define TARGET_API_MAC_OSX 1
397
+ #elif defined(TARGET_CARBON) && TARGET_CARBON
398
+ /* grandfather in use of TARGET_CARBON */
399
+ #define TARGET_API_MAC_OS8 0
400
+ #define TARGET_API_MAC_CARBON 1
401
+ #define TARGET_API_MAC_OSX 0
402
+ #elif TARGET_CPU_PPC && TARGET_RT_MAC_CFM
403
+ /* Looks like CFM style PPC compiler */
404
+ #define TARGET_API_MAC_OS8 1
405
+ #define TARGET_API_MAC_CARBON 0
406
+ #define TARGET_API_MAC_OSX 0
407
+ #else
408
+ /* 68k or some other compiler */
409
+ #define TARGET_API_MAC_OS8 1
410
+ #define TARGET_API_MAC_CARBON 0
411
+ #define TARGET_API_MAC_OSX 0
412
+ #endif /* */
413
+
414
+ #else
415
+ #ifndef TARGET_API_MAC_OS8
416
+ #define TARGET_API_MAC_OS8 0
417
+ #endif /* !defined(TARGET_API_MAC_OS8) */
418
+
419
+ #ifndef TARGET_API_MAC_OSX
420
+ #define TARGET_API_MAC_OSX TARGET_RT_MAC_MACHO
421
+ #endif /* !defined(TARGET_API_MAC_OSX) */
422
+
423
+ #ifndef TARGET_API_MAC_CARBON
424
+ #define TARGET_API_MAC_CARBON TARGET_API_MAC_OSX
425
+ #endif /* !defined(TARGET_API_MAC_CARBON) */
426
+
427
+ #endif /* !defined(TARGET_API_MAC_OS8) && !defined(TARGET_API_MAC_OSX) && !defined(TARGET_API_MAC_CARBON) */
428
+
429
+ #if TARGET_API_MAC_OS8 && TARGET_API_MAC_OSX
430
+ #error TARGET_API_MAC_OS8 and TARGET_API_MAC_OSX are mutually exclusive
431
+ #endif /* TARGET_API_MAC_OS8 && TARGET_API_MAC_OSX */
432
+
433
+ #if !TARGET_API_MAC_OS8 && !TARGET_API_MAC_CARBON && !TARGET_API_MAC_OSX
434
+ #error At least one of TARGET_API_MAC_* must be true
435
+ #endif /* !TARGET_API_MAC_OS8 && !TARGET_API_MAC_CARBON && !TARGET_API_MAC_OSX */
436
+
437
+ /* Support source code still using TARGET_CARBON */
438
+ #ifndef TARGET_CARBON
439
+ #if TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8
440
+ #define TARGET_CARBON 1
441
+ #else
442
+ #define TARGET_CARBON 0
443
+ #endif /* TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8 */
444
+
445
+ #endif /* !defined(TARGET_CARBON) */
446
+
447
+ /****************************************************************************************************
448
+ Backward compatibility for clients expecting 2.x version on ConditionalMacros.h
449
+
450
+ GENERATINGPOWERPC - Compiler is generating PowerPC instructions
451
+ GENERATING68K - Compiler is generating 68k family instructions
452
+ GENERATING68881 - Compiler is generating mc68881 floating point instructions
453
+ GENERATINGCFM - Code being generated assumes CFM calling conventions
454
+ CFMSYSTEMCALLS - No A-traps. Systems calls are made using CFM and UPP's
455
+ PRAGMA_ALIGN_SUPPORTED - Compiler supports: #pragma options align=mac68k/power/reset
456
+ PRAGMA_IMPORT_SUPPORTED - Compiler supports: #pragma import on/off/reset
457
+ CGLUESUPPORTED - Clients can use all lowercase toolbox functions that take C strings instead of pascal strings
458
+
459
+ ****************************************************************************************************/
460
+ #if !TARGET_API_MAC_CARBON
461
+ #define GENERATINGPOWERPC TARGET_CPU_PPC
462
+ #define GENERATING68K 0
463
+ #define GENERATING68881 TARGET_RT_MAC_68881
464
+ #define GENERATINGCFM TARGET_RT_MAC_CFM
465
+ #define CFMSYSTEMCALLS TARGET_RT_MAC_CFM
466
+ #ifndef CGLUESUPPORTED
467
+ #define CGLUESUPPORTED 0
468
+ #endif /* !defined(CGLUESUPPORTED) */
469
+
470
+ #ifndef OLDROUTINELOCATIONS
471
+ #define OLDROUTINELOCATIONS 0
472
+ #endif /* !defined(OLDROUTINELOCATIONS) */
473
+
474
+ #define PRAGMA_ALIGN_SUPPORTED PRAGMA_STRUCT_ALIGN
475
+ #define PRAGMA_IMPORT_SUPPORTED PRAGMA_IMPORT
476
+ #else
477
+ /* Carbon code should not use old conditionals */
478
+ #define PRAGMA_ALIGN_SUPPORTED ..PRAGMA_ALIGN_SUPPORTED_is_obsolete..
479
+ #define GENERATINGPOWERPC ..GENERATINGPOWERPC_is_obsolete..
480
+ #define GENERATING68K ..GENERATING68K_is_obsolete..
481
+ #define GENERATING68881 ..GENERATING68881_is_obsolete..
482
+ #define GENERATINGCFM ..GENERATINGCFM_is_obsolete..
483
+ #define CFMSYSTEMCALLS ..CFMSYSTEMCALLS_is_obsolete..
484
+ #endif /* !TARGET_API_MAC_CARBON */
485
+
486
+
487
+
488
+ /****************************************************************************************************
489
+
490
+ OLDROUTINENAMES - "Old" names for Macintosh system calls are allowed in source code.
491
+ (e.g. DisposPtr instead of DisposePtr). The names of system routine
492
+ are now more sensitive to change because CFM binds by name. In the
493
+ past, system routine names were compiled out to just an A-Trap.
494
+ Macros have been added that each map an old name to its new name.
495
+ This allows old routine names to be used in existing source files,
496
+ but the macros only work if OLDROUTINENAMES is true. This support
497
+ will be removed in the near future. Thus, all source code should
498
+ be changed to use the new names! You can set OLDROUTINENAMES to false
499
+ to see if your code has any old names left in it.
500
+
501
+ ****************************************************************************************************/
502
+ #ifndef OLDROUTINENAMES
503
+ #define OLDROUTINENAMES 0
504
+ #endif /* !defined(OLDROUTINENAMES) */
505
+
506
+
507
+
508
+ /****************************************************************************************************
509
+ The following macros isolate the use of 68K inlines in function prototypes.
510
+ On the Mac OS under the Classic 68K runtime, function prototypes were followed
511
+ by a list of 68K opcodes which the compiler inserted in the generated code instead
512
+ of a JSR. Under Classic 68K on the Mac OS, this macro will put the opcodes
513
+ in the right syntax. For all other OS's and runtimes the macro suppress the opcodes.
514
+ Example:
515
+
516
+ EXTERN_P void DrawPicture(PicHandle myPicture, const Rect *dstRect)
517
+ ONEWORDINLINE(0xA8F6);
518
+
519
+ ****************************************************************************************************/
520
+
521
+ #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
522
+ #define ONEWORDINLINE(w1) = w1
523
+ #define TWOWORDINLINE(w1,w2) = {w1,w2}
524
+ #define THREEWORDINLINE(w1,w2,w3) = {w1,w2,w3}
525
+ #define FOURWORDINLINE(w1,w2,w3,w4) = {w1,w2,w3,w4}
526
+ #define FIVEWORDINLINE(w1,w2,w3,w4,w5) = {w1,w2,w3,w4,w5}
527
+ #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6) = {w1,w2,w3,w4,w5,w6}
528
+ #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7) = {w1,w2,w3,w4,w5,w6,w7}
529
+ #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8) = {w1,w2,w3,w4,w5,w6,w7,w8}
530
+ #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9) = {w1,w2,w3,w4,w5,w6,w7,w8,w9}
531
+ #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10) = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10}
532
+ #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11) = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11}
533
+ #define TWELVEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12) = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12}
534
+ #else
535
+ #define ONEWORDINLINE(w1)
536
+ #define TWOWORDINLINE(w1,w2)
537
+ #define THREEWORDINLINE(w1,w2,w3)
538
+ #define FOURWORDINLINE(w1,w2,w3,w4)
539
+ #define FIVEWORDINLINE(w1,w2,w3,w4,w5)
540
+ #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6)
541
+ #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7)
542
+ #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8)
543
+ #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9)
544
+ #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10)
545
+ #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11)
546
+ #define TWELVEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12)
547
+ #endif
548
+
549
+
550
+ /****************************************************************************************************
551
+
552
+ TARGET_CARBON - default: false. Switches all of the above as described. Overrides all others
553
+ - NOTE: If you set TARGET_CARBON to 1, then the other switches will be setup by
554
+ ConditionalMacros, and should not be set manually.
555
+
556
+ If you wish to do development for pre-Carbon Systems, you can set the following:
557
+
558
+ OPAQUE_TOOLBOX_STRUCTS - default: false. True for Carbon builds, hides struct fields.
559
+ OPAQUE_UPP_TYPES - default: false. True for Carbon builds, UPP types are unique and opaque.
560
+ ACCESSOR_CALLS_ARE_FUNCTIONS - default: false. True for Carbon builds, enables accessor functions.
561
+ CALL_NOT_IN_CARBON - default: true. False for Carbon builds, hides calls not supported in Carbon.
562
+
563
+ Specifically, if you are building a non-Carbon application (one that links against InterfaceLib)
564
+ but you wish to use some of the accessor functions, you can set ACCESSOR_CALLS_ARE_FUNCTIONS to 1
565
+ and link with CarbonAccessors.o, which implements just the accessor functions. This will help you
566
+ preserve source compatibility between your Carbon and non-Carbon application targets.
567
+
568
+ MIXEDMODE_CALLS_ARE_FUNCTIONS - deprecated.
569
+
570
+ ****************************************************************************************************/
571
+ #if TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8
572
+ #ifndef OPAQUE_TOOLBOX_STRUCTS
573
+ #define OPAQUE_TOOLBOX_STRUCTS 1
574
+ #endif /* !defined(OPAQUE_TOOLBOX_STRUCTS) */
575
+
576
+ #ifndef OPAQUE_UPP_TYPES
577
+ #define OPAQUE_UPP_TYPES 1
578
+ #endif /* !defined(OPAQUE_UPP_TYPES) */
579
+
580
+ #ifndef ACCESSOR_CALLS_ARE_FUNCTIONS
581
+ #define ACCESSOR_CALLS_ARE_FUNCTIONS 1
582
+ #endif /* !defined(ACCESSOR_CALLS_ARE_FUNCTIONS) */
583
+
584
+ #ifndef CALL_NOT_IN_CARBON
585
+ #define CALL_NOT_IN_CARBON 0
586
+ #endif /* !defined(CALL_NOT_IN_CARBON) */
587
+
588
+ #ifndef MIXEDMODE_CALLS_ARE_FUNCTIONS
589
+ #define MIXEDMODE_CALLS_ARE_FUNCTIONS 1
590
+ #endif /* !defined(MIXEDMODE_CALLS_ARE_FUNCTIONS) */
591
+
592
+ #else
593
+ #ifndef OPAQUE_TOOLBOX_STRUCTS
594
+ #define OPAQUE_TOOLBOX_STRUCTS 0
595
+ #endif /* !defined(OPAQUE_TOOLBOX_STRUCTS) */
596
+
597
+ #ifndef ACCESSOR_CALLS_ARE_FUNCTIONS
598
+ #define ACCESSOR_CALLS_ARE_FUNCTIONS 0
599
+ #endif /* !defined(ACCESSOR_CALLS_ARE_FUNCTIONS) */
600
+
601
+ /*
602
+ * It's possible to have ACCESSOR_CALLS_ARE_FUNCTIONS set to true and OPAQUE_TOOLBOX_STRUCTS
603
+ * set to false, but not the other way around, so make sure the defines are not set this way.
604
+ */
605
+ #ifndef CALL_NOT_IN_CARBON
606
+ #define CALL_NOT_IN_CARBON 1
607
+ #endif /* !defined(CALL_NOT_IN_CARBON) */
608
+
609
+ #ifndef MIXEDMODE_CALLS_ARE_FUNCTIONS
610
+ #define MIXEDMODE_CALLS_ARE_FUNCTIONS 0
611
+ #endif /* !defined(MIXEDMODE_CALLS_ARE_FUNCTIONS) */
612
+
613
+ #endif /* TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8 */
614
+
615
+
616
+
617
+
618
+ #endif /* __CONDITIONALMACROS__ */
619
+
@@ -1,5 +1,6 @@
1
1
  module ObjectiveC [system] {
2
2
  header "objc/NSObject.h"
3
+ header "objc/objc-sync.h"
3
4
  link "objc"
4
5
  export *
5
6
  }
@@ -0,0 +1,59 @@
1
+ /*
2
+ * Copyright (c) 2002, 2006 Apple Inc. All Rights Reserved.
3
+ *
4
+ * @APPLE_LICENSE_HEADER_START@
5
+ *
6
+ * This file contains Original Code and/or Modifications of Original Code
7
+ * as defined in and that are subject to the Apple Public Source License
8
+ * Version 2.0 (the 'License'). You may not use this file except in
9
+ * compliance with the License. Please obtain a copy of the License at
10
+ * http://www.opensource.apple.com/apsl/ and read it before using this
11
+ * file.
12
+ *
13
+ * The Original Code and all software distributed under the License are
14
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18
+ * Please see the License for the specific language governing rights and
19
+ * limitations under the License.
20
+ *
21
+ * @APPLE_LICENSE_HEADER_END@
22
+ */
23
+
24
+ #ifndef __OBJC_SNYC_H_
25
+ #define __OBJC_SNYC_H_
26
+
27
+ #include <objc/objc.h>
28
+
29
+
30
+ /**
31
+ * Begin synchronizing on 'obj'.
32
+ * Allocates recursive pthread_mutex associated with 'obj' if needed.
33
+ *
34
+ * @param obj The object to begin synchronizing on.
35
+ *
36
+ * @return OBJC_SYNC_SUCCESS once lock is acquired.
37
+ */
38
+ OBJC_EXPORT int
39
+ objc_sync_enter(id _Nonnull obj)
40
+ OBJC_AVAILABLE(10.3, 2.0, 9.0, 1.0, 2.0);
41
+
42
+ /**
43
+ * End synchronizing on 'obj'.
44
+ *
45
+ * @param obj The object to end synchronizing on.
46
+ *
47
+ * @return OBJC_SYNC_SUCCESS or OBJC_SYNC_NOT_OWNING_THREAD_ERROR
48
+ */
49
+ OBJC_EXPORT int
50
+ objc_sync_exit(id _Nonnull obj)
51
+ OBJC_AVAILABLE(10.3, 2.0, 9.0, 1.0, 2.0);
52
+
53
+ enum {
54
+ OBJC_SYNC_SUCCESS = 0,
55
+ OBJC_SYNC_NOT_OWNING_THREAD_ERROR = -1
56
+ };
57
+
58
+
59
+ #endif // __OBJC_SYNC_H_