1 | /* |
---|
2 | * Copyright (c) 2000-2014 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: TargetConditionals.h |
---|
26 | |
---|
27 | Contains: Autoconfiguration of TARGET_ conditionals for Mac OS X and iPhone |
---|
28 | |
---|
29 | Note: TargetConditionals.h in 3.4 Universal Interfaces works |
---|
30 | with all compilers. This header only recognizes compilers |
---|
31 | known to run on Mac OS X. |
---|
32 | |
---|
33 | */ |
---|
34 | |
---|
35 | #ifndef __TARGETCONDITIONALS__ |
---|
36 | #define __TARGETCONDITIONALS__ |
---|
37 | |
---|
38 | /* |
---|
39 | * |
---|
40 | * TARGET_CPU_* |
---|
41 | * These conditionals specify which microprocessor instruction set is being |
---|
42 | * generated. At most one of these is true, the rest are false. |
---|
43 | * |
---|
44 | * TARGET_CPU_PPC - Compiler is generating PowerPC instructions for 32-bit mode |
---|
45 | * TARGET_CPU_PPC64 - Compiler is generating PowerPC instructions for 64-bit mode |
---|
46 | * TARGET_CPU_68K - Compiler is generating 680x0 instructions |
---|
47 | * TARGET_CPU_X86 - Compiler is generating x86 instructions for 32-bit mode |
---|
48 | * TARGET_CPU_X86_64 - Compiler is generating x86 instructions for 64-bit mode |
---|
49 | * TARGET_CPU_ARM - Compiler is generating ARM instructions for 32-bit mode |
---|
50 | * TARGET_CPU_ARM64 - Compiler is generating ARM instructions for 64-bit mode |
---|
51 | * TARGET_CPU_MIPS - Compiler is generating MIPS instructions |
---|
52 | * TARGET_CPU_SPARC - Compiler is generating Sparc instructions |
---|
53 | * TARGET_CPU_ALPHA - Compiler is generating Dec Alpha instructions |
---|
54 | */ |
---|
55 | |
---|
56 | /* |
---|
57 | * TARGET_OS_* |
---|
58 | * |
---|
59 | * These conditionals specify in which Operating System the generated code will |
---|
60 | * run. Indention is used to show which conditionals are evolutionary subclasses. |
---|
61 | * |
---|
62 | * The MAC/WIN32/UNIX conditionals are mutually exclusive. |
---|
63 | * The IOS/TV/WATCH/VISION conditionals are mutually exclusive. |
---|
64 | * |
---|
65 | * TARGET_OS_WIN32 - Generated code will run on WIN32 API |
---|
66 | * TARGET_OS_WINDOWS - Generated code will run on Windows |
---|
67 | * TARGET_OS_UNIX - Generated code will run on some Unix (not macOS) |
---|
68 | * TARGET_OS_LINUX - Generated code will run on Linux |
---|
69 | * TARGET_OS_MAC - Generated code will run on a variant of macOS |
---|
70 | * TARGET_OS_OSX - Generated code will run on macOS |
---|
71 | * TARGET_OS_IPHONE - Generated code will run on a variant of iOS (firmware, devices, simulator) |
---|
72 | * TARGET_OS_IOS - Generated code will run on iOS |
---|
73 | * TARGET_OS_MACCATALYST - Generated code will run on macOS |
---|
74 | * TARGET_OS_TV - Generated code will run on tvOS |
---|
75 | * TARGET_OS_WATCH - Generated code will run on watchOS |
---|
76 | * TARGET_OS_VISION - Generated code will run on visionOS |
---|
77 | * TARGET_OS_BRIDGE - Generated code will run on bridge devices |
---|
78 | * TARGET_OS_SIMULATOR - Generated code will run on an iOS, tvOS, watchOS, or visionOS simulator |
---|
79 | * TARGET_OS_DRIVERKIT - Generated code will run on macOS, iOS, tvOS, watchOS, or visionOS |
---|
80 | * |
---|
81 | * TARGET_OS_EMBEDDED - DEPRECATED: Use TARGET_OS_IPHONE and/or TARGET_OS_SIMULATOR instead |
---|
82 | * TARGET_IPHONE_SIMULATOR - DEPRECATED: Same as TARGET_OS_SIMULATOR |
---|
83 | * TARGET_OS_NANO - DEPRECATED: Same as TARGET_OS_WATCH |
---|
84 | * |
---|
85 | * +--------------------------------------------------------------------------------------+ |
---|
86 | * | TARGET_OS_MAC | |
---|
87 | * | +-----+ +------------------------------------------------------------+ +-----------+ | |
---|
88 | * | | | | TARGET_OS_IPHONE | | | | |
---|
89 | * | | | | +-----------------+ +----+ +-------+ +--------+ +--------+ | | | | |
---|
90 | * | | | | | IOS | | | | | | | | | | | | | |
---|
91 | * | | OSX | | | +-------------+ | | TV | | WATCH | | BRIDGE | | VISION | | | DRIVERKIT | | |
---|
92 | * | | | | | | MACCATALYST | | | | | | | | | | | | | | |
---|
93 | * | | | | | +-------------+ | | | | | | | | | | | | | |
---|
94 | * | | | | +-----------------+ +----+ +-------+ +--------+ +--------+ | | | | |
---|
95 | * | +-----+ +------------------------------------------------------------+ +-----------+ | |
---|
96 | * +--------------------------------------------------------------------------------------+ |
---|
97 | */ |
---|
98 | |
---|
99 | /* |
---|
100 | * TARGET_RT_* |
---|
101 | * |
---|
102 | * These conditionals specify in which runtime the generated code will |
---|
103 | * run. This is needed when the OS and CPU support more than one runtime |
---|
104 | * (e.g. Mac OS X supports CFM and mach-o). |
---|
105 | * |
---|
106 | * TARGET_RT_LITTLE_ENDIAN - Generated code uses little endian format for integers |
---|
107 | * TARGET_RT_BIG_ENDIAN - Generated code uses big endian format for integers |
---|
108 | * TARGET_RT_64_BIT - Generated code uses 64-bit pointers |
---|
109 | * TARGET_RT_MAC_CFM - TARGET_OS_MAC is true and CFM68K or PowerPC CFM (TVectors) are used |
---|
110 | * TARGET_RT_MAC_MACHO - TARGET_OS_MAC is true and Mach-O/dlyd runtime is used |
---|
111 | */ |
---|
112 | |
---|
113 | /* |
---|
114 | * TARGET_OS conditionals can be enabled via clang preprocessor extensions: |
---|
115 | * |
---|
116 | * __is_target_arch |
---|
117 | * __is_target_vendor |
---|
118 | * __is_target_os |
---|
119 | * __is_target_environment |
---|
120 | * |
---|
121 | * "-target=x86_64-apple-ios12-macabi" |
---|
122 | * TARGET_OS_MAC=1 |
---|
123 | * TARGET_OS_IPHONE=1 |
---|
124 | * TARGET_OS_IOS=1 |
---|
125 | * TARGET_OS_MACCATALYST=1 |
---|
126 | * |
---|
127 | * "-target=x86_64-apple-ios12-simulator" |
---|
128 | * TARGET_OS_MAC=1 |
---|
129 | * TARGET_OS_IPHONE=1 |
---|
130 | * TARGET_OS_IOS=1 |
---|
131 | * TARGET_OS_SIMULATOR=1 |
---|
132 | * |
---|
133 | * DYNAMIC_TARGETS_ENABLED indicates that the core TARGET_OS macros were enabled via clang preprocessor extensions. |
---|
134 | * If this value is not set, the macro enablements will fall back to the static behavior. |
---|
135 | * It is disabled by default. |
---|
136 | */ |
---|
137 | |
---|
138 | #if defined(__has_builtin) |
---|
139 | #if __has_builtin(__is_target_arch) |
---|
140 | #if __has_builtin(__is_target_vendor) |
---|
141 | #if __has_builtin(__is_target_os) |
---|
142 | #if __has_builtin(__is_target_environment) |
---|
143 | |
---|
144 | /* "-target=x86_64-apple-ios12-macabi" */ |
---|
145 | /* "-target=arm64-apple-ios12-macabi" */ |
---|
146 | /* "-target=arm64e-apple-ios12-macabi" */ |
---|
147 | #if (__is_target_arch(x86_64) || __is_target_arch(arm64) || __is_target_arch(arm64e)) && __is_target_vendor(apple) && __is_target_os(ios) && __is_target_environment(macabi) |
---|
148 | #define TARGET_OS_MAC 1 |
---|
149 | #define TARGET_OS_OSX 0 |
---|
150 | #define TARGET_OS_IPHONE 1 |
---|
151 | #define TARGET_OS_IOS 1 |
---|
152 | #define TARGET_OS_WATCH 0 |
---|
153 | |
---|
154 | #define TARGET_OS_TV 0 |
---|
155 | #define TARGET_OS_SIMULATOR 0 |
---|
156 | #define TARGET_OS_EMBEDDED 0 |
---|
157 | #define TARGET_OS_RTKIT 0 |
---|
158 | #define TARGET_OS_MACCATALYST 1 |
---|
159 | #define TARGET_OS_MACCATALYST 1 |
---|
160 | |
---|
161 | #define TARGET_OS_VISION 0 |
---|
162 | |
---|
163 | |
---|
164 | #ifndef TARGET_OS_UIKITFORMAC |
---|
165 | #define TARGET_OS_UIKITFORMAC 1 |
---|
166 | #endif |
---|
167 | #define TARGET_OS_DRIVERKIT 0 |
---|
168 | #define DYNAMIC_TARGETS_ENABLED 1 |
---|
169 | #endif |
---|
170 | |
---|
171 | /* "-target=x86_64-apple-ios12-simulator" */ |
---|
172 | /* "-target=arm64-apple-ios12-simulator" */ |
---|
173 | /* "-target=arm64e-apple-ios12-simulator" */ |
---|
174 | #if (__is_target_arch(x86_64) || __is_target_arch(arm64) || __is_target_arch(arm64e)) && __is_target_vendor(apple) && __is_target_os(ios) && __is_target_environment(simulator) |
---|
175 | #define TARGET_OS_MAC 1 |
---|
176 | #define TARGET_OS_OSX 0 |
---|
177 | #define TARGET_OS_IPHONE 1 |
---|
178 | #define TARGET_OS_IOS 1 |
---|
179 | #define TARGET_OS_WATCH 0 |
---|
180 | |
---|
181 | #define TARGET_OS_TV 0 |
---|
182 | #define TARGET_OS_SIMULATOR 1 |
---|
183 | #define TARGET_OS_EMBEDDED 0 |
---|
184 | #define TARGET_OS_RTKIT 0 |
---|
185 | #define TARGET_OS_MACCATALYST 0 |
---|
186 | #define TARGET_OS_MACCATALYST 0 |
---|
187 | |
---|
188 | #define TARGET_OS_VISION 0 |
---|
189 | |
---|
190 | |
---|
191 | #ifndef TARGET_OS_UIKITFORMAC |
---|
192 | #define TARGET_OS_UIKITFORMAC 0 |
---|
193 | #endif |
---|
194 | #define TARGET_OS_DRIVERKIT 0 |
---|
195 | #define DYNAMIC_TARGETS_ENABLED 1 |
---|
196 | #endif |
---|
197 | |
---|
198 | |
---|
199 | |
---|
200 | /* "-target=arm64e-apple-xros1.0" */ |
---|
201 | #if (__is_target_arch(arm64e) || __is_target_arch(arm64)) && __is_target_vendor(apple) && __is_target_os(xros) |
---|
202 | #define TARGET_OS_MAC 1 |
---|
203 | #define TARGET_OS_OSX 0 |
---|
204 | #define TARGET_OS_IPHONE 1 |
---|
205 | |
---|
206 | #define TARGET_OS_IOS 0 |
---|
207 | |
---|
208 | #define TARGET_OS_WATCH 0 |
---|
209 | |
---|
210 | #define TARGET_OS_TV 0 |
---|
211 | #define TARGET_OS_SIMULATOR 0 |
---|
212 | #define TARGET_OS_EMBEDDED 1 |
---|
213 | #define TARGET_OS_RTKIT 0 |
---|
214 | #define TARGET_OS_MACCATALYST 0 |
---|
215 | #define TARGET_OS_MACCATALYST 0 |
---|
216 | |
---|
217 | #define TARGET_OS_VISION 1 |
---|
218 | |
---|
219 | |
---|
220 | #ifndef TARGET_OS_UIKITFORMAC |
---|
221 | #define TARGET_OS_UIKITFORMAC 0 |
---|
222 | #endif |
---|
223 | #define TARGET_OS_DRIVERKIT 0 |
---|
224 | #define DYNAMIC_TARGETS_ENABLED 1 |
---|
225 | #endif |
---|
226 | |
---|
227 | /* "-target=arm64e-apple-xros1.0-simulator" */ |
---|
228 | #if (__is_target_arch(x86_64) || __is_target_arch(arm64) || __is_target_arch(arm64e)) && __is_target_vendor(apple) && __is_target_os(xros) && __is_target_environment(simulator) |
---|
229 | #define TARGET_OS_MAC 1 |
---|
230 | #define TARGET_OS_OSX 0 |
---|
231 | #define TARGET_OS_IPHONE 1 |
---|
232 | |
---|
233 | #define TARGET_OS_IOS 0 |
---|
234 | |
---|
235 | #define TARGET_OS_WATCH 0 |
---|
236 | |
---|
237 | #define TARGET_OS_TV 0 |
---|
238 | #define TARGET_OS_SIMULATOR 1 |
---|
239 | #define TARGET_OS_EMBEDDED 0 |
---|
240 | #define TARGET_OS_RTKIT 0 |
---|
241 | #define TARGET_OS_MACCATALYST 0 |
---|
242 | #define TARGET_OS_MACCATALYST 0 |
---|
243 | |
---|
244 | #define TARGET_OS_VISION 1 |
---|
245 | |
---|
246 | |
---|
247 | #ifndef TARGET_OS_UIKITFORMAC |
---|
248 | #define TARGET_OS_UIKITFORMAC 0 |
---|
249 | #endif |
---|
250 | #define TARGET_OS_DRIVERKIT 0 |
---|
251 | #define DYNAMIC_TARGETS_ENABLED 1 |
---|
252 | #endif |
---|
253 | |
---|
254 | |
---|
255 | |
---|
256 | //FIXME: Workaround for rdar://100536146 |
---|
257 | #if (__is_target_vendor(apple) && defined(__APPLE_EXCLAVECORE__) && __APPLE_EXCLAVECORE__) |
---|
258 | #define TARGET_OS_MAC 0 |
---|
259 | #define TARGET_OS_OSX 0 |
---|
260 | #define TARGET_OS_IPHONE 0 |
---|
261 | #define TARGET_OS_IOS 0 |
---|
262 | #define TARGET_OS_WATCH 0 |
---|
263 | |
---|
264 | #define TARGET_OS_TV 0 |
---|
265 | #define TARGET_OS_SIMULATOR 0 |
---|
266 | #define TARGET_OS_EMBEDDED 0 |
---|
267 | #define TARGET_OS_RTKIT 0 |
---|
268 | #define TARGET_OS_MACCATALYST 0 |
---|
269 | #define TARGET_OS_MACCATALYST 0 |
---|
270 | |
---|
271 | #define TARGET_OS_VISION 0 |
---|
272 | |
---|
273 | |
---|
274 | #ifndef TARGET_OS_UIKITFORMAC |
---|
275 | #define TARGET_OS_UIKITFORMAC 0 |
---|
276 | #endif |
---|
277 | #define TARGET_OS_DRIVERKIT 0 |
---|
278 | #define DYNAMIC_TARGETS_ENABLED 1 |
---|
279 | #endif |
---|
280 | |
---|
281 | |
---|
282 | |
---|
283 | //FIXME: Workaround for rdar://100536146 |
---|
284 | #if (__is_target_vendor(apple) && defined(__APPLE_EXCLAVEKIT__) && __APPLE_EXCLAVEKIT__) |
---|
285 | #define TARGET_OS_MAC 1 |
---|
286 | #define TARGET_OS_OSX 0 |
---|
287 | #define TARGET_OS_IPHONE 0 |
---|
288 | #define TARGET_OS_IOS 0 |
---|
289 | #define TARGET_OS_WATCH 0 |
---|
290 | |
---|
291 | #define TARGET_OS_TV 0 |
---|
292 | #define TARGET_OS_SIMULATOR 0 |
---|
293 | #define TARGET_OS_EMBEDDED 0 |
---|
294 | #define TARGET_OS_RTKIT 0 |
---|
295 | #define TARGET_OS_MACCATALYST 0 |
---|
296 | #define TARGET_OS_MACCATALYST 0 |
---|
297 | |
---|
298 | #define TARGET_OS_VISION 0 |
---|
299 | |
---|
300 | |
---|
301 | #ifndef TARGET_OS_UIKITFORMAC |
---|
302 | #define TARGET_OS_UIKITFORMAC 0 |
---|
303 | #endif |
---|
304 | #define TARGET_OS_DRIVERKIT 0 |
---|
305 | #define DYNAMIC_TARGETS_ENABLED 1 |
---|
306 | #endif |
---|
307 | |
---|
308 | /* "-target=x86_64-apple-driverkit19.0" */ |
---|
309 | /* "-target=arm64-apple-driverkit19.0" */ |
---|
310 | /* "-target=arm64e-apple-driverkit19.0" */ |
---|
311 | #if __is_target_vendor(apple) && __is_target_os(driverkit) |
---|
312 | #define TARGET_OS_MAC 1 |
---|
313 | #define TARGET_OS_OSX 0 |
---|
314 | #define TARGET_OS_IPHONE 0 |
---|
315 | #define TARGET_OS_IOS 0 |
---|
316 | #define TARGET_OS_WATCH 0 |
---|
317 | |
---|
318 | #define TARGET_OS_TV 0 |
---|
319 | #define TARGET_OS_SIMULATOR 0 |
---|
320 | #define TARGET_OS_EMBEDDED 0 |
---|
321 | #define TARGET_OS_RTKIT 0 |
---|
322 | #define TARGET_OS_MACCATALYST 0 |
---|
323 | #define TARGET_OS_MACCATALYST 0 |
---|
324 | |
---|
325 | #define TARGET_OS_VISION 0 |
---|
326 | |
---|
327 | |
---|
328 | #ifndef TARGET_OS_UIKITFORMAC |
---|
329 | #define TARGET_OS_UIKITFORMAC 0 |
---|
330 | #endif |
---|
331 | #define TARGET_OS_DRIVERKIT 1 |
---|
332 | #define DYNAMIC_TARGETS_ENABLED 1 |
---|
333 | #endif |
---|
334 | |
---|
335 | #endif /* #if __has_builtin(__is_target_environment) */ |
---|
336 | #endif /* #if __has_builtin(__is_target_os) */ |
---|
337 | #endif /* #if __has_builtin(__is_target_vendor) */ |
---|
338 | #endif /* #if __has_builtin(__is_target_arch) */ |
---|
339 | #endif /* #if defined(__has_builtin) */ |
---|
340 | |
---|
341 | |
---|
342 | #ifndef DYNAMIC_TARGETS_ENABLED |
---|
343 | #define DYNAMIC_TARGETS_ENABLED 0 |
---|
344 | #endif /* DYNAMIC_TARGETS_ENABLED */ |
---|
345 | |
---|
346 | /* |
---|
347 | * gcc based compiler used on Mac OS X |
---|
348 | */ |
---|
349 | #if defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__MACOS_CLASSIC__) ) |
---|
350 | #define TARGET_OS_WIN32 0 |
---|
351 | #define TARGET_OS_WINDOWS 0 |
---|
352 | #define TARGET_OS_UNIX 0 |
---|
353 | #define TARGET_OS_LINUX 0 |
---|
354 | |
---|
355 | #if !DYNAMIC_TARGETS_ENABLED |
---|
356 | #define TARGET_OS_MAC 1 |
---|
357 | #define TARGET_OS_OSX 1 |
---|
358 | #define TARGET_OS_IPHONE 0 |
---|
359 | |
---|
360 | #define TARGET_OS_IOS 0 |
---|
361 | |
---|
362 | #define TARGET_OS_WATCH 0 |
---|
363 | |
---|
364 | #define TARGET_OS_TV 0 |
---|
365 | #define TARGET_OS_MACCATALYST 0 |
---|
366 | #define TARGET_OS_MACCATALYST 0 |
---|
367 | |
---|
368 | |
---|
369 | |
---|
370 | #define TARGET_OS_VISION 0 |
---|
371 | #ifndef TARGET_OS_UIKITFORMAC |
---|
372 | #define TARGET_OS_UIKITFORMAC 0 |
---|
373 | #endif |
---|
374 | #define TARGET_OS_SIMULATOR 0 |
---|
375 | #define TARGET_OS_EMBEDDED 0 |
---|
376 | #define TARGET_OS_RTKIT 0 |
---|
377 | #define TARGET_OS_DRIVERKIT 0 |
---|
378 | #endif |
---|
379 | |
---|
380 | #define TARGET_IPHONE_SIMULATOR TARGET_OS_SIMULATOR /* deprecated */ |
---|
381 | #define TARGET_OS_NANO TARGET_OS_WATCH /* deprecated */ |
---|
382 | |
---|
383 | #define TARGET_ABI_USES_IOS_VALUES (!TARGET_CPU_X86_64 || (TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST)) |
---|
384 | #if defined(__ppc__) |
---|
385 | #define TARGET_CPU_PPC 1 |
---|
386 | #define TARGET_CPU_PPC64 0 |
---|
387 | #define TARGET_CPU_68K 0 |
---|
388 | #define TARGET_CPU_X86 0 |
---|
389 | #define TARGET_CPU_X86_64 0 |
---|
390 | #define TARGET_CPU_ARM 0 |
---|
391 | #define TARGET_CPU_ARM64 0 |
---|
392 | #define TARGET_CPU_MIPS 0 |
---|
393 | #define TARGET_CPU_SPARC 0 |
---|
394 | #define TARGET_CPU_ALPHA 0 |
---|
395 | #define TARGET_RT_LITTLE_ENDIAN 0 |
---|
396 | #define TARGET_RT_BIG_ENDIAN 1 |
---|
397 | #define TARGET_RT_64_BIT 0 |
---|
398 | #ifdef __MACOS_CLASSIC__ |
---|
399 | #define TARGET_RT_MAC_CFM 1 |
---|
400 | #define TARGET_RT_MAC_MACHO 0 |
---|
401 | #else |
---|
402 | #define TARGET_RT_MAC_CFM 0 |
---|
403 | #define TARGET_RT_MAC_MACHO 1 |
---|
404 | #endif |
---|
405 | #elif defined(__ppc64__) |
---|
406 | #define TARGET_CPU_PPC 0 |
---|
407 | #define TARGET_CPU_PPC64 1 |
---|
408 | #define TARGET_CPU_68K 0 |
---|
409 | #define TARGET_CPU_X86 0 |
---|
410 | #define TARGET_CPU_X86_64 0 |
---|
411 | #define TARGET_CPU_ARM 0 |
---|
412 | #define TARGET_CPU_ARM64 0 |
---|
413 | #define TARGET_CPU_MIPS 0 |
---|
414 | #define TARGET_CPU_SPARC 0 |
---|
415 | #define TARGET_CPU_ALPHA 0 |
---|
416 | #define TARGET_RT_LITTLE_ENDIAN 0 |
---|
417 | #define TARGET_RT_BIG_ENDIAN 1 |
---|
418 | #define TARGET_RT_64_BIT 1 |
---|
419 | #define TARGET_RT_MAC_CFM 0 |
---|
420 | #define TARGET_RT_MAC_MACHO 1 |
---|
421 | #elif defined(__i386__) |
---|
422 | #define TARGET_CPU_PPC 0 |
---|
423 | #define TARGET_CPU_PPC64 0 |
---|
424 | #define TARGET_CPU_68K 0 |
---|
425 | #define TARGET_CPU_X86 1 |
---|
426 | #define TARGET_CPU_X86_64 0 |
---|
427 | #define TARGET_CPU_ARM 0 |
---|
428 | #define TARGET_CPU_ARM64 0 |
---|
429 | #define TARGET_CPU_MIPS 0 |
---|
430 | #define TARGET_CPU_SPARC 0 |
---|
431 | #define TARGET_CPU_ALPHA 0 |
---|
432 | #define TARGET_RT_MAC_CFM 0 |
---|
433 | #define TARGET_RT_MAC_MACHO 1 |
---|
434 | #define TARGET_RT_LITTLE_ENDIAN 1 |
---|
435 | #define TARGET_RT_BIG_ENDIAN 0 |
---|
436 | #define TARGET_RT_64_BIT 0 |
---|
437 | #elif defined(__x86_64__) |
---|
438 | #define TARGET_CPU_PPC 0 |
---|
439 | #define TARGET_CPU_PPC64 0 |
---|
440 | #define TARGET_CPU_68K 0 |
---|
441 | #define TARGET_CPU_X86 0 |
---|
442 | #define TARGET_CPU_X86_64 1 |
---|
443 | #define TARGET_CPU_ARM 0 |
---|
444 | #define TARGET_CPU_ARM64 0 |
---|
445 | #define TARGET_CPU_MIPS 0 |
---|
446 | #define TARGET_CPU_SPARC 0 |
---|
447 | #define TARGET_CPU_ALPHA 0 |
---|
448 | #define TARGET_RT_MAC_CFM 0 |
---|
449 | #define TARGET_RT_MAC_MACHO 1 |
---|
450 | #define TARGET_RT_LITTLE_ENDIAN 1 |
---|
451 | #define TARGET_RT_BIG_ENDIAN 0 |
---|
452 | #define TARGET_RT_64_BIT 1 |
---|
453 | #elif defined(__arm__) |
---|
454 | #define TARGET_CPU_PPC 0 |
---|
455 | #define TARGET_CPU_PPC64 0 |
---|
456 | #define TARGET_CPU_68K 0 |
---|
457 | #define TARGET_CPU_X86 0 |
---|
458 | #define TARGET_CPU_X86_64 0 |
---|
459 | #define TARGET_CPU_ARM 1 |
---|
460 | #define TARGET_CPU_ARM64 0 |
---|
461 | #define TARGET_CPU_MIPS 0 |
---|
462 | #define TARGET_CPU_SPARC 0 |
---|
463 | #define TARGET_CPU_ALPHA 0 |
---|
464 | #define TARGET_RT_MAC_CFM 0 |
---|
465 | #define TARGET_RT_MAC_MACHO 1 |
---|
466 | #define TARGET_RT_LITTLE_ENDIAN 1 |
---|
467 | #define TARGET_RT_BIG_ENDIAN 0 |
---|
468 | #define TARGET_RT_64_BIT 0 |
---|
469 | #elif defined(__arm64__) |
---|
470 | #define TARGET_CPU_PPC 0 |
---|
471 | #define TARGET_CPU_PPC64 0 |
---|
472 | #define TARGET_CPU_68K 0 |
---|
473 | #define TARGET_CPU_X86 0 |
---|
474 | #define TARGET_CPU_X86_64 0 |
---|
475 | #define TARGET_CPU_ARM 0 |
---|
476 | #define TARGET_CPU_ARM64 1 |
---|
477 | #define TARGET_CPU_MIPS 0 |
---|
478 | #define TARGET_CPU_SPARC 0 |
---|
479 | #define TARGET_CPU_ALPHA 0 |
---|
480 | #define TARGET_RT_MAC_CFM 0 |
---|
481 | #define TARGET_RT_MAC_MACHO 1 |
---|
482 | #define TARGET_RT_LITTLE_ENDIAN 1 |
---|
483 | #define TARGET_RT_BIG_ENDIAN 0 |
---|
484 | #if __LP64__ |
---|
485 | #define TARGET_RT_64_BIT 1 |
---|
486 | #else |
---|
487 | #define TARGET_RT_64_BIT 0 |
---|
488 | #endif |
---|
489 | #else |
---|
490 | #error unrecognized GNU C compiler |
---|
491 | #endif |
---|
492 | |
---|
493 | |
---|
494 | |
---|
495 | /* |
---|
496 | * CodeWarrior compiler from Metrowerks/Motorola |
---|
497 | */ |
---|
498 | #elif defined(__MWERKS__) |
---|
499 | #define TARGET_OS_MAC 1 |
---|
500 | #define TARGET_OS_WIN32 0 |
---|
501 | #define TARGET_OS_WINDOWS 0 |
---|
502 | #define TARGET_OS_UNIX 0 |
---|
503 | #define TARGET_OS_LINUX 0 |
---|
504 | #define TARGET_OS_EMBEDDED 0 |
---|
505 | #if defined(__POWERPC__) |
---|
506 | #define TARGET_CPU_PPC 1 |
---|
507 | #define TARGET_CPU_PPC64 0 |
---|
508 | #define TARGET_CPU_68K 0 |
---|
509 | #define TARGET_CPU_X86 0 |
---|
510 | #define TARGET_CPU_MIPS 0 |
---|
511 | #define TARGET_CPU_SPARC 0 |
---|
512 | #define TARGET_CPU_ALPHA 0 |
---|
513 | #define TARGET_RT_LITTLE_ENDIAN 0 |
---|
514 | #define TARGET_RT_BIG_ENDIAN 1 |
---|
515 | #elif defined(__INTEL__) |
---|
516 | #define TARGET_CPU_PPC 0 |
---|
517 | #define TARGET_CPU_PPC64 0 |
---|
518 | #define TARGET_CPU_68K 0 |
---|
519 | #define TARGET_CPU_X86 1 |
---|
520 | #define TARGET_CPU_MIPS 0 |
---|
521 | #define TARGET_CPU_SPARC 0 |
---|
522 | #define TARGET_CPU_ALPHA 0 |
---|
523 | #define TARGET_RT_LITTLE_ENDIAN 1 |
---|
524 | #define TARGET_RT_BIG_ENDIAN 0 |
---|
525 | #else |
---|
526 | #error unknown Metrowerks CPU type |
---|
527 | #endif |
---|
528 | #define TARGET_RT_64_BIT 0 |
---|
529 | #ifdef __MACH__ |
---|
530 | #define TARGET_RT_MAC_CFM 0 |
---|
531 | #define TARGET_RT_MAC_MACHO 1 |
---|
532 | #else |
---|
533 | #define TARGET_RT_MAC_CFM 1 |
---|
534 | #define TARGET_RT_MAC_MACHO 0 |
---|
535 | #endif |
---|
536 | |
---|
537 | /* |
---|
538 | * unknown compiler |
---|
539 | */ |
---|
540 | #else |
---|
541 | #if defined(TARGET_CPU_PPC) && TARGET_CPU_PPC |
---|
542 | #define TARGET_CPU_PPC64 0 |
---|
543 | #define TARGET_CPU_68K 0 |
---|
544 | #define TARGET_CPU_X86 0 |
---|
545 | #define TARGET_CPU_X86_64 0 |
---|
546 | #define TARGET_CPU_ARM 0 |
---|
547 | #define TARGET_CPU_ARM64 0 |
---|
548 | #define TARGET_CPU_MIPS 0 |
---|
549 | #define TARGET_CPU_SPARC 0 |
---|
550 | #define TARGET_CPU_ALPHA 0 |
---|
551 | #elif defined(TARGET_CPU_PPC64) && TARGET_CPU_PPC64 |
---|
552 | #define TARGET_CPU_PPC 0 |
---|
553 | #define TARGET_CPU_68K 0 |
---|
554 | #define TARGET_CPU_X86 0 |
---|
555 | #define TARGET_CPU_X86_64 0 |
---|
556 | #define TARGET_CPU_ARM 0 |
---|
557 | #define TARGET_CPU_ARM64 0 |
---|
558 | #define TARGET_CPU_MIPS 0 |
---|
559 | #define TARGET_CPU_SPARC 0 |
---|
560 | #define TARGET_CPU_ALPHA 0 |
---|
561 | #elif defined(TARGET_CPU_X86) && TARGET_CPU_X86 |
---|
562 | #define TARGET_CPU_PPC 0 |
---|
563 | #define TARGET_CPU_PPC64 0 |
---|
564 | #define TARGET_CPU_X86_64 0 |
---|
565 | #define TARGET_CPU_68K 0 |
---|
566 | #define TARGET_CPU_ARM 0 |
---|
567 | #define TARGET_CPU_ARM64 0 |
---|
568 | #define TARGET_CPU_MIPS 0 |
---|
569 | #define TARGET_CPU_SPARC 0 |
---|
570 | #define TARGET_CPU_ALPHA 0 |
---|
571 | #elif defined(TARGET_CPU_X86_64) && TARGET_CPU_X86_64 |
---|
572 | #define TARGET_CPU_PPC 0 |
---|
573 | #define TARGET_CPU_PPC64 0 |
---|
574 | #define TARGET_CPU_X86 0 |
---|
575 | #define TARGET_CPU_68K 0 |
---|
576 | #define TARGET_CPU_ARM 0 |
---|
577 | #define TARGET_CPU_ARM64 0 |
---|
578 | #define TARGET_CPU_MIPS 0 |
---|
579 | #define TARGET_CPU_SPARC 0 |
---|
580 | #define TARGET_CPU_ALPHA 0 |
---|
581 | #elif defined(TARGET_CPU_ARM) && TARGET_CPU_ARM |
---|
582 | #define TARGET_CPU_PPC 0 |
---|
583 | #define TARGET_CPU_PPC64 0 |
---|
584 | #define TARGET_CPU_X86 0 |
---|
585 | #define TARGET_CPU_X86_64 0 |
---|
586 | #define TARGET_CPU_68K 0 |
---|
587 | #define TARGET_CPU_ARM64 0 |
---|
588 | #define TARGET_CPU_MIPS 0 |
---|
589 | #define TARGET_CPU_SPARC 0 |
---|
590 | #define TARGET_CPU_ALPHA 0 |
---|
591 | #elif defined(TARGET_CPU_ARM64) && TARGET_CPU_ARM64 |
---|
592 | #define TARGET_CPU_PPC 0 |
---|
593 | #define TARGET_CPU_PPC64 0 |
---|
594 | #define TARGET_CPU_X86 0 |
---|
595 | #define TARGET_CPU_X86_64 0 |
---|
596 | #define TARGET_CPU_68K 0 |
---|
597 | #define TARGET_CPU_ARM 0 |
---|
598 | #define TARGET_CPU_MIPS 0 |
---|
599 | #define TARGET_CPU_SPARC 0 |
---|
600 | #define TARGET_CPU_ALPHA 0 |
---|
601 | #else |
---|
602 | /* |
---|
603 | NOTE: If your compiler errors out here then support for your compiler |
---|
604 | has not yet been added to TargetConditionals.h. |
---|
605 | |
---|
606 | TargetConditionals.h is designed to be plug-and-play. It auto detects |
---|
607 | which compiler is being run and configures the TARGET_ conditionals |
---|
608 | appropriately. |
---|
609 | |
---|
610 | The short term work around is to set the TARGET_CPU_ and TARGET_OS_ |
---|
611 | on the command line to the compiler (e.g. -DTARGET_CPU_MIPS=1 -DTARGET_OS_UNIX=1) |
---|
612 | |
---|
613 | The long term solution is to add a new case to this file which |
---|
614 | auto detects your compiler and sets up the TARGET_ conditionals. |
---|
615 | Then submit the changes to Apple Computer. |
---|
616 | */ |
---|
617 | #error TargetConditionals.h: unknown compiler (see comment above) |
---|
618 | #define TARGET_CPU_PPC 0 |
---|
619 | #define TARGET_CPU_68K 0 |
---|
620 | #define TARGET_CPU_X86 0 |
---|
621 | #define TARGET_CPU_ARM 0 |
---|
622 | #define TARGET_CPU_ARM64 0 |
---|
623 | #define TARGET_CPU_MIPS 0 |
---|
624 | #define TARGET_CPU_SPARC 0 |
---|
625 | #define TARGET_CPU_ALPHA 0 |
---|
626 | #endif |
---|
627 | #define TARGET_OS_MAC 1 |
---|
628 | #define TARGET_OS_WIN32 0 |
---|
629 | #define TARGET_OS_WINDOWS 0 |
---|
630 | #define TARGET_OS_UNIX 0 |
---|
631 | #define TARGET_OS_LINUX 0 |
---|
632 | #define TARGET_OS_EMBEDDED 0 |
---|
633 | #if TARGET_CPU_PPC || TARGET_CPU_PPC64 |
---|
634 | #define TARGET_RT_BIG_ENDIAN 1 |
---|
635 | #define TARGET_RT_LITTLE_ENDIAN 0 |
---|
636 | #else |
---|
637 | #define TARGET_RT_BIG_ENDIAN 0 |
---|
638 | #define TARGET_RT_LITTLE_ENDIAN 1 |
---|
639 | #endif |
---|
640 | #if TARGET_CPU_PPC64 || TARGET_CPU_X86_64 |
---|
641 | #define TARGET_RT_64_BIT 1 |
---|
642 | #else |
---|
643 | #define TARGET_RT_64_BIT 0 |
---|
644 | #endif |
---|
645 | #ifdef __MACH__ |
---|
646 | #define TARGET_RT_MAC_MACHO 1 |
---|
647 | #define TARGET_RT_MAC_CFM 0 |
---|
648 | #else |
---|
649 | #define TARGET_RT_MAC_MACHO 0 |
---|
650 | #define TARGET_RT_MAC_CFM 1 |
---|
651 | #endif |
---|
652 | |
---|
653 | #endif |
---|
654 | |
---|
655 | #endif /* __TARGETCONDITIONALS__ */ |
---|