|
|
1.1 root 1: /*
2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3: *
4: * @APPLE_LICENSE_HEADER_START@
5: *
6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7: * Reserved. This file contains Original Code and/or Modifications of
8: * Original Code as defined in and that are subject to the Apple Public
9: * Source License Version 1.1 (the "License"). You may not use this file
10: * except in compliance with the License. Please obtain a copy of the
11: * License at http://www.apple.com/publicsource and read it before using
12: * this file.
13: *
14: * The Original Code and all software distributed under the License are
15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19: * License for the specific language governing rights and limitations
20: * under the License.
21: *
22: * @APPLE_LICENSE_HEADER_END@
23: */
24:
25: /*
26: File: ConditionalMacros.h
27:
28: Contains: Set up for compiler independent conditionals
29:
30: Version: Universal Interface Files 3.2
31:
32: DRI: Nick Kledzik
33:
34: Copyright: � 1993-1998 by Apple Computer, Inc., all rights reserved
35:
36: Warning: *** APPLE INTERNAL USE ONLY ***
37: This file may contain unreleased API's
38:
39: BuildInfo: Built by: Naga Pappireddi
40: With Interfacer: 3.0d9 (PowerPC native)
41: From: ConditionalMacros.i
42: Revision: 102
43: Dated: 9/2/98
44: Last change by: GW
45: Last comment: (Really johng) BlueBox builds on Rhapsody need TARGET_OS_MAC,
46:
47: Bugs: Report bugs to Radar component "System Interfaces", "Latest"
48: List the version information (from above) in the Problem Description.
49:
50: */
51: #ifndef __CONDITIONALMACROS__
52: #define __CONDITIONALMACROS__
53:
54: /****************************************************************************************************
55: UNIVERSAL_INTERFACES_VERSION
56:
57: 0x0320 => version 3.2
58: 0x0310 => version 3.1
59: 0x0301 => version 3.0.1
60: 0x0300 => version 3.0
61: 0x0210 => version 2.1
62: This conditional did not exist prior to version 2.1
63: ****************************************************************************************************/
64: #define UNIVERSAL_INTERFACES_VERSION 0x0320
65:
66: /****************************************************************************************************
67:
68: TARGET_CPU_�
69: These conditionals specify which microprocessor instruction set is being
70: generated. At most one of these is true, the rest are false.
71:
72: TARGET_CPU_PPC - Compiler is generating PowerPC instructions
73: TARGET_CPU_68K - Compiler is generating 680x0 instructions
74: TARGET_CPU_X86 - Compiler is generating x86 instructions
75: TARGET_CPU_MIPS - Compiler is generating MIPS instructions
76: TARGET_CPU_SPARC - Compiler is generating Sparc instructions
77: TARGET_CPU_ALPHA - Compiler is generating Dec Alpha instructions
78:
79:
80: TARGET_OS_�
81: These conditionals specify in which Operating System the generated code will
82: run. At most one of the these is true, the rest are false.
83:
84: TARGET_OS_MAC - Generate code will run under Mac OS
85: TARGET_OS_WIN32 - Generate code will run under 32-bit Windows
86: TARGET_OS_UNIX - Generate code will run under some unix
87:
88:
89: TARGET_RT_�
90: These conditionals specify in which runtime the generated code will
91: run. This is needed when the OS and CPU support more than one runtime
92: (e.g. MacOS on 68K supports CFM68K and Classic 68k).
93:
94: TARGET_RT_LITTLE_ENDIAN - Generated code uses little endian format for integers
95: TARGET_RT_BIG_ENDIAN - Generated code uses big endian format for integers
96: TARGET_RT_MAC_CFM - TARGET_OS_MAC is true and CFM68K or PowerPC CFM being used
97: TARGET_RT_MAC_68881 - TARGET_OS_MAC is true and 68881 floating point instructions used
98:
99:
100: PRAGMA_�
101: These conditionals specify whether the compiler supports particular #pragma's
102:
103: PRAGMA_IMPORT - Compiler supports: #pragma import on/off/reset
104: PRAGMA_ONCE - Compiler supports: #pragma once
105: PRAGMA_STRUCT_ALIGN - Compiler supports: #pragma options align=mac68k/power/reset
106: PRAGMA_STRUCT_PACK - Compiler supports: #pragma pack(n)
107: PRAGMA_STRUCT_PACKPUSH - Compiler supports: #pragma pack(push, n)/pack(pop)
108: PRAGMA_ENUM_PACK - Compiler supports: #pragma options(!pack_enums)
109: PRAGMA_ENUM_ALWAYSINT - Compiler supports: #pragma enumsalwaysint on/off/reset
110: PRAGMA_ENUM_OPTIONS - Compiler supports: #pragma options enum=int/small/reset
111:
112: FOUR_CHAR_CODE
113: This conditional does the proper byte swapping to assue that a four character code (e.g. 'TEXT')
114: is compiled down to the correct value on all compilers.
115:
116: FOUR_CHAR_CODE('abcd') - Convert a four-char-code to the correct 32-bit value
117:
118: TYPE_�
119: These conditionals specify whether the compiler supports particular types.
120:
121: TYPE_LONGLONG - Compiler supports "long long" 64-bit integers
122: TYPE_BOOL - Compiler supports "bool"
123: TYPE_EXTENDED - Compiler supports "extended" 80/96 bit floating point
124:
125: ****************************************************************************************************/
126:
127: #if defined(__MRC__)
128: /*
129: MrC[pp] compiler from Apple Computer, Inc.
130: */
131: #define TARGET_CPU_PPC 1
132: #define TARGET_CPU_68K 0
133: #define TARGET_CPU_X86 0
134: #define TARGET_CPU_MIPS 0
135: #define TARGET_CPU_SPARC 0
136: #define TARGET_CPU_ALPHA 0
137: #define TARGET_OS_MAC 1
138: #define TARGET_OS_WIN32 0
139: #define TARGET_OS_UNIX 0
140: #define TARGET_RT_LITTLE_ENDIAN 0
141: #define TARGET_RT_BIG_ENDIAN 1
142: #define TARGET_RT_MAC_CFM 1
143: #define TARGET_RT_MAC_68881 0
144: #if (__MRC__ > 0x0200) && (__MRC__ < 0x0700)
145: #define PRAGMA_IMPORT 1
146: #else
147: #define PRAGMA_IMPORT 0
148: #endif
149: #define PRAGMA_STRUCT_ALIGN 1
150: #define PRAGMA_ONCE 1
151: #define PRAGMA_STRUCT_PACK 0
152: #define PRAGMA_STRUCT_PACKPUSH 0
153: #define PRAGMA_ENUM_PACK 1
154: #define PRAGMA_ENUM_ALWAYSINT 0
155: #define PRAGMA_ENUM_OPTIONS 0
156: #define FOUR_CHAR_CODE(x) (x)
157:
158: #if (__MRC__ > 0x0300) && (__MRC__ < 0x0700)
159: #if __option(longlong)
160: #define TYPE_LONGLONG 1
161: #else
162: #define TYPE_LONGLONG 0
163: #endif
164: #if __option(bool)
165: #define TYPE_BOOL 1
166: #else
167: #define TYPE_BOOL 0
168: #endif
169: #else
170: #define TYPE_LONGLONG 0
171: #define TYPE_BOOL 0
172: #endif
173: #define TYPE_EXTENDED 0
174:
175:
176:
177: #elif defined(__SC__) && (defined(MPW_CPLUS) || defined(MPW_C))
178: /*
179: SC[pp] compiler from Apple Computer, Inc.
180: */
181: #define TARGET_CPU_PPC 0
182: #define TARGET_CPU_68K 1
183: #define TARGET_CPU_X86 0
184: #define TARGET_CPU_MIPS 0
185: #define TARGET_CPU_SPARC 0
186: #define TARGET_CPU_ALPHA 0
187: #define TARGET_OS_MAC 1
188: #define TARGET_OS_WIN32 0
189: #define TARGET_OS_UNIX 0
190: #define TARGET_RT_LITTLE_ENDIAN 0
191: #define TARGET_RT_BIG_ENDIAN 1
192: #if defined(__CFM68K__)
193: #define TARGET_RT_MAC_CFM 1
194: #else
195: #define TARGET_RT_MAC_CFM 0
196: #endif
197: #if defined(mc68881)
198: #define TARGET_RT_MAC_68881 1
199: #else
200: #define TARGET_RT_MAC_68881 0
201: #endif
202: #if TARGET_RT_MAC_CFM
203: #define PRAGMA_IMPORT 1
204: #if (__SC__ <= 0x0810)
205: /* old versions of SC don't support �#pragma import reset� */
206: #define PRAGMA_IMPORT_OFF 1
207: #endif
208: #else
209: #define PRAGMA_IMPORT 0
210: #endif
211: #if (__SC__ >= 0x0801)
212: #define PRAGMA_STRUCT_ALIGN 1
213: #else
214: #define PRAGMA_STRUCT_ALIGN 0
215: #endif
216: #define PRAGMA_ONCE 0
217: #define PRAGMA_STRUCT_PACK 0
218: #define PRAGMA_STRUCT_PACKPUSH 0
219: #define PRAGMA_ENUM_PACK 1
220: #define PRAGMA_ENUM_ALWAYSINT 0
221: #define PRAGMA_ENUM_OPTIONS 0
222: #define FOUR_CHAR_CODE(x) (x)
223:
224: #define TYPE_LONGLONG 0
225: #define TYPE_EXTENDED 1
226: #if (__SC__ > 0x0810)
227: #if __option(bool)
228: #define TYPE_BOOL 1
229: #else
230: #define TYPE_BOOL 0
231: #endif
232: #else
233: #define TYPE_BOOL 0
234: #endif
235:
236:
237:
238: #elif defined(__MWERKS__)
239: /*
240: CodeWarrior compiler from Metrowerks, Inc.
241: */
242: #if (__MWERKS__ < 0x0900) || macintosh
243: #define TARGET_OS_MAC 1
244: #define TARGET_OS_WIN32 0
245: #define TARGET_OS_UNIX 0
246: #define TARGET_CPU_X86 0
247: #define TARGET_CPU_MIPS 0
248: #define TARGET_CPU_SPARC 0
249: #define TARGET_CPU_ALPHA 0
250: #define TARGET_RT_LITTLE_ENDIAN 0
251: #define TARGET_RT_BIG_ENDIAN 1
252: #if powerc
253: #define TARGET_CPU_PPC 1
254: #define TARGET_CPU_68K 0
255: #define TARGET_RT_MAC_CFM 1
256: #define TARGET_RT_MAC_68881 0
257: #else
258: #define TARGET_CPU_PPC 0
259: #define TARGET_CPU_68K 1
260: #if defined(__CFM68K__)
261: #define TARGET_RT_MAC_CFM 1
262: #else
263: #define TARGET_RT_MAC_CFM 0
264: #endif
265: #if __MC68881__
266: #define TARGET_RT_MAC_68881 1
267: #else
268: #define TARGET_RT_MAC_68881 0
269: #endif
270: #endif
271: #define PRAGMA_ONCE 1
272: #if (__MWERKS__ >= 0x0700)
273: #define PRAGMA_IMPORT TARGET_RT_MAC_CFM
274: #else
275: #define PRAGMA_IMPORT 0
276: #endif
277: #define PRAGMA_STRUCT_ALIGN 1
278: #define PRAGMA_STRUCT_PACK 0
279: #define PRAGMA_STRUCT_PACKPUSH 0
280: #define PRAGMA_ENUM_PACK 0
281: #define PRAGMA_ENUM_ALWAYSINT 1
282: #define PRAGMA_ENUM_OPTIONS 0
283: #define FOUR_CHAR_CODE(x) (x)
284:
285:
286: #elif (__MWERKS__ >= 0x0900) && __INTEL__
287: #define TARGET_CPU_PPC 0
288: #define TARGET_CPU_68K 0
289: #define TARGET_CPU_X86 1
290: #define TARGET_CPU_MIPS 0
291: #define TARGET_CPU_SPARC 0
292: #define TARGET_CPU_ALPHA 0
293: #define TARGET_OS_MAC 0
294: #define TARGET_OS_WIN32 1
295: #define TARGET_OS_UNIX 0
296: #define TARGET_RT_LITTLE_ENDIAN 1
297: #define TARGET_RT_BIG_ENDIAN 0
298: #define TARGET_RT_MAC_CFM 0
299: #define TARGET_RT_MAC_68881 0
300: #define PRAGMA_ONCE 1
301: #define PRAGMA_IMPORT 0
302: #define PRAGMA_STRUCT_ALIGN 0
303: #define PRAGMA_STRUCT_PACK 1
304: #define PRAGMA_STRUCT_PACKPUSH 1
305: #define PRAGMA_ENUM_PACK 0
306: #define PRAGMA_ENUM_ALWAYSINT 1
307: #define PRAGMA_ENUM_OPTIONS 0
308: #define FOUR_CHAR_CODE(x) (x)
309:
310:
311: #elif (__MWERKS__ >= 0x1900) && __MIPS__
312: #define TARGET_CPU_PPC 0
313: #define TARGET_CPU_68K 0
314: #define TARGET_CPU_X86 0
315: #define TARGET_CPU_MIPS 1
316: #define TARGET_CPU_SPARC 0
317: #define TARGET_CPU_ALPHA 0
318: #define TARGET_OS_MAC 0
319: #define TARGET_OS_WIN32 0
320: #define TARGET_OS_UNIX 1
321: #if __option(little_endian)
322: #define TARGET_RT_LITTLE_ENDIAN 1
323: #define TARGET_RT_BIG_ENDIAN 0
324: #else
325: #define TARGET_RT_LITTLE_ENDIAN 0
326: #define TARGET_RT_BIG_ENDIAN 1
327: #endif
328: #define TARGET_RT_MAC_CFM 0
329: #define TARGET_RT_MAC_68881 0
330: #define PRAGMA_ONCE 1
331: #define PRAGMA_IMPORT 0
332: #define PRAGMA_STRUCT_ALIGN 0
333: #define PRAGMA_STRUCT_PACK 1
334: #define PRAGMA_STRUCT_PACKPUSH 0
335: #define PRAGMA_ENUM_PACK 0
336: #define PRAGMA_ENUM_ALWAYSINT 1
337: #define PRAGMA_ENUM_OPTIONS 0
338: #define FOUR_CHAR_CODE(x) (x)
339:
340:
341:
342: #elif (__MWERKS__ >= 0x2110) && NeXT
343: #define TARGET_CPU_PPC 1
344: #define TARGET_CPU_68K 0
345: #define TARGET_CPU_X86 0
346: #define TARGET_CPU_MIPS 0
347: #define TARGET_CPU_SPARC 0
348: #define TARGET_CPU_ALPHA 0
349: #define TARGET_OS_MAC 0
350: #define TARGET_OS_WIN32 0
351: #define TARGET_OS_UNIX 1
352: #if __option(little_endian)
353: #define TARGET_RT_LITTLE_ENDIAN 1
354: #define TARGET_RT_BIG_ENDIAN 0
355: #else
356: #define TARGET_RT_LITTLE_ENDIAN 0
357: #define TARGET_RT_BIG_ENDIAN 1
358: #endif
359: #define TARGET_RT_MAC_CFM 0
360: #define TARGET_RT_MAC_68881 0
361: #define PRAGMA_ONCE 1
362: #define PRAGMA_IMPORT 0
363: #define PRAGMA_STRUCT_ALIGN 0
364: #define PRAGMA_STRUCT_PACK 1
365: #define PRAGMA_STRUCT_PACKPUSH 0
366: #define PRAGMA_ENUM_PACK 0
367: #define PRAGMA_ENUM_ALWAYSINT 1
368: #define PRAGMA_ENUM_OPTIONS 0
369: #define FOUR_CHAR_CODE(x) (x)
370:
371:
372: #define forCarbon 1
373:
374:
375: #else
376: #error unknown Metrowerks compiler
377: #endif
378:
379:
380: #if (__MWERKS__ >= 0x1100)
381: #if __option(longlong)
382: #define TYPE_LONGLONG 1
383: #else
384: #define TYPE_LONGLONG 0
385: #endif
386: #else
387: #define TYPE_LONGLONG 0
388: #endif
389: #if (__MWERKS__ >= 0x1000)
390: #if __option(bool)
391: #define TYPE_BOOL 1
392: #else
393: #define TYPE_BOOL 0
394: #endif
395: #else
396: #define TYPE_BOOL 0
397: #endif
398: #define TYPE_EXTENDED 0
399:
400:
401:
402: #elif defined(SYMANTEC_CPLUS) || defined(SYMANTEC_C)
403: /*
404: C and C++ compiler from Symantec, Inc.
405: */
406: #define TARGET_OS_MAC 1
407: #define TARGET_OS_WIN32 0
408: #define TARGET_OS_UNIX 0
409: #define TARGET_CPU_X86 0
410: #define TARGET_CPU_MIPS 0
411: #define TARGET_CPU_SPARC 0
412: #define TARGET_CPU_ALPHA 0
413: #define TARGET_RT_LITTLE_ENDIAN 0
414: #define TARGET_RT_BIG_ENDIAN 1
415: #if powerc
416: #define TARGET_CPU_PPC 1
417: #define TARGET_CPU_68K 0
418: #define TARGET_RT_MAC_CFM 1
419: #define TARGET_RT_MAC_68881 0
420: #else
421: #define TARGET_CPU_PPC 0
422: #define TARGET_CPU_68K 1
423: #if defined(__CFM68K)
424: #define TARGET_RT_MAC_CFM 1
425: #else
426: #define TARGET_RT_MAC_CFM 0
427: #endif
428: #if mc68881
429: #define TARGET_RT_MAC_68881 1
430: #else
431: #define TARGET_RT_MAC_68881 0
432: #endif
433: #endif
434: #define PRAGMA_IMPORT 0
435: #define PRAGMA_ONCE 1
436: #define PRAGMA_STRUCT_ALIGN 1
437: #define PRAGMA_STRUCT_PACK 0
438: #define PRAGMA_STRUCT_PACKPUSH 0
439: #define PRAGMA_ENUM_PACK 1
440: #define PRAGMA_ENUM_ALWAYSINT 0
441: #define PRAGMA_ENUM_OPTIONS 0
442: #define FOUR_CHAR_CODE(x) (x)
443:
444: #if __useAppleExts__
445: #define TYPE_EXTENDED 1
446: #else
447: #define TYPE_EXTENDED 0
448: #endif
449: #define TYPE_LONGLONG 0
450: #define TYPE_BOOL 0
451:
452:
453:
454: #elif defined(THINK_C)
455: /*
456: THINK C compiler from Symantec, Inc. << WARNING: Unsupported Compiler >>
457: */
458: #define TARGET_CPU_PPC 0
459: #define TARGET_CPU_68K 1
460: #define TARGET_CPU_X86 0
461: #define TARGET_CPU_MIPS 0
462: #define TARGET_CPU_SPARC 0
463: #define TARGET_CPU_ALPHA 0
464: #define TARGET_OS_MAC 1
465: #define TARGET_OS_WIN32 0
466: #define TARGET_OS_UNIX 0
467: #define TARGET_RT_LITTLE_ENDIAN 0
468: #define TARGET_RT_BIG_ENDIAN 1
469: #define TARGET_RT_MAC_CFM 0
470: #if defined(mc68881)
471: #define TARGET_RT_MAC_68881 1
472: #else
473: #define TARGET_RT_MAC_68881 0
474: #endif
475: #define PRAGMA_IMPORT 0
476: #define PRAGMA_STRUCT_ALIGN 0
477: #define PRAGMA_ONCE 1
478: #define PRAGMA_STRUCT_PACK 0
479: #define PRAGMA_STRUCT_PACKPUSH 0
480: #define PRAGMA_ENUM_PACK 1
481: #define PRAGMA_ENUM_ALWAYSINT 0
482: #define PRAGMA_ENUM_OPTIONS 0
483: #define FOUR_CHAR_CODE(x) (x)
484:
485: #define TYPE_EXTENDED 1
486: #define TYPE_LONGLONG 0
487: #define TYPE_BOOL 0
488:
489:
490:
491: #elif defined(__PPCC__)
492: /*
493: PPCC compiler from Apple Computer, Inc. << WARNING: Unsupported Compiler >>
494: */
495: #define TARGET_CPU_PPC 1
496: #define TARGET_CPU_68K 0
497: #define TARGET_CPU_X86 0
498: #define TARGET_CPU_MIPS 0
499: #define TARGET_CPU_SPARC 0
500: #define TARGET_CPU_ALPHA 0
501: #define TARGET_OS_MAC 1
502: #define TARGET_OS_WIN32 0
503: #define TARGET_OS_UNIX 0
504: #define TARGET_RT_LITTLE_ENDIAN 0
505: #define TARGET_RT_BIG_ENDIAN 1
506: #define TARGET_RT_MAC_CFM 1
507: #define TARGET_RT_MAC_68881 0
508: #define PRAGMA_IMPORT 0
509: #define PRAGMA_STRUCT_ALIGN 1
510: #define PRAGMA_ONCE 0
511: #define PRAGMA_STRUCT_PACK 0
512: #define PRAGMA_STRUCT_PACKPUSH 0
513: #define PRAGMA_ENUM_PACK 0
514: #define PRAGMA_ENUM_ALWAYSINT 0
515: #define PRAGMA_ENUM_OPTIONS 0
516: #define FOUR_CHAR_CODE(x) (x)
517:
518: #define TYPE_EXTENDED 0
519: #define TYPE_LONGLONG 0
520: #define TYPE_BOOL 0
521:
522:
523: #elif defined(applec) && !defined(__SC__)
524: /*
525: MPW C compiler from Apple Computer, Inc. << WARNING: Unsupported Compiler >>
526: */
527: #define TARGET_CPU_PPC 0
528: #define TARGET_CPU_68K 1
529: #define TARGET_CPU_X86 0
530: #define TARGET_CPU_MIPS 0
531: #define TARGET_CPU_SPARC 0
532: #define TARGET_CPU_ALPHA 0
533: #define TARGET_OS_MAC 1
534: #define TARGET_OS_WIN32 0
535: #define TARGET_OS_UNIX 0
536: #define TARGET_RT_LITTLE_ENDIAN 0
537: #define TARGET_RT_BIG_ENDIAN 1
538: #define TARGET_RT_MAC_CFM 0
539: #if defined(mc68881)
540: #define TARGET_RT_MAC_68881 1
541: #else
542: #define TARGET_RT_MAC_68881 0
543: #endif
544: #define PRAGMA_IMPORT 0
545: #define PRAGMA_STRUCT_ALIGN 0
546: #define PRAGMA_ONCE 0
547: #define PRAGMA_STRUCT_PACK 0
548: #define PRAGMA_STRUCT_PACKPUSH 0
549: #define PRAGMA_ENUM_PACK 0
550: #define PRAGMA_ENUM_ALWAYSINT 0
551: #define PRAGMA_ENUM_OPTIONS 0
552: /* Note: MPW C 3.2 had a bug where MACRO('xx ') would cause 'xx ' to be misevaluated */
553: #define FOUR_CHAR_CODE
554:
555: #define TYPE_EXTENDED 1
556: #define TYPE_LONGLONG 0
557: #define TYPE_BOOL 0
558:
559:
560:
561: #elif defined(__GNUC__) && (defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__NEXT_CPP__))
562: /*
563: gcc from Next, Inc., with cpp-precomp (header precompiler)
564: */
565: #if defined(powerpc) || defined(ppc)
566: #define TARGET_CPU_PPC 1
567: #define TARGET_CPU_68K 0
568: #define TARGET_CPU_X86 0
569: #define TARGET_CPU_MIPS 0
570: #define TARGET_CPU_SPARC 0
571: #define TARGET_CPU_ALPHA 0
572: #define TARGET_RT_MAC_CFM 0
573: #define TARGET_RT_MAC_68881 0
574: #define TARGET_RT_LITTLE_ENDIAN 0
575: #define TARGET_RT_BIG_ENDIAN 1
576: #elif defined(m68k)
577: #define TARGET_CPU_PPC 0
578: #define TARGET_CPU_68K 1
579: #define TARGET_CPU_X86 0
580: #define TARGET_CPU_MIPS 0
581: #define TARGET_CPU_SPARC 0
582: #define TARGET_CPU_ALPHA 0
583: #define TARGET_RT_MAC_CFM 0
584: #define TARGET_RT_MAC_68881 0
585: #define TARGET_RT_LITTLE_ENDIAN 0
586: #define TARGET_RT_BIG_ENDIAN 1
587: #elif defined(sparc)
588: #define TARGET_CPU_PPC 0
589: #define TARGET_CPU_68K 0
590: #define TARGET_CPU_X86 0
591: #define TARGET_CPU_MIPS 0
592: #define TARGET_CPU_SPARC 1
593: #define TARGET_CPU_ALPHA 0
594: #define TARGET_RT_MAC_CFM 0
595: #define TARGET_RT_MAC_68881 0
596: #define TARGET_RT_LITTLE_ENDIAN 0
597: #define TARGET_RT_BIG_ENDIAN 1
598: #elif defined(i386) || defined(intel)
599: #define TARGET_CPU_PPC 0
600: #define TARGET_CPU_68K 0
601: #define TARGET_CPU_X86 1
602: #define TARGET_CPU_MIPS 0
603: #define TARGET_CPU_SPARC 0
604: #define TARGET_CPU_ALPHA 0
605: #define TARGET_RT_MAC_CFM 0
606: #define TARGET_RT_MAC_68881 0
607: #define TARGET_RT_LITTLE_ENDIAN 1
608: #define TARGET_RT_BIG_ENDIAN 0
609: #else
610: #error unrecognized NeXT GNU C compiler
611: #endif
612:
613: /* BlueBox wants TARGET_OS_MAC when compiling on Rhapsody.
614: Carbon wants TARGET_OS_UNIX (for now, at least).
615: Similarly, BlueBox wants TARGET_RT_MAC_CFM=1 and Carbon does not.
616: Since BlueBox does an -Asystem(macos) on the command line for builds,
617: these conditionals below let us all be happy campers. */
618:
619: #if #system(macos)
620: #define TARGET_OS_MAC 1
621: #define TARGET_OS_WIN32 0
622: #define TARGET_OS_UNIX 0
623: #undef TARGET_RT_MAC_CFM /* different from above setting */
624: #define TARGET_RT_MAC_CFM 1
625: #else
626: #define TARGET_OS_MAC 0
627: #define TARGET_OS_WIN32 0
628: #define TARGET_OS_UNIX 1
629: #endif
630:
631:
632: #define PRAGMA_IMPORT 0
633: #define PRAGMA_STRUCT_ALIGN 1
634: #define PRAGMA_ONCE 0
635: #define PRAGMA_STRUCT_PACK 0
636: #define PRAGMA_STRUCT_PACKPUSH 0
637: #define PRAGMA_ENUM_PACK 0
638: #define PRAGMA_ENUM_ALWAYSINT 0
639: #define PRAGMA_ENUM_OPTIONS 0
640: #define FOUR_CHAR_CODE(x) (x)
641:
642: #define TYPE_EXTENDED 0
643: #ifdef _LONG_LONG
644: #define TYPE_LONGLONG 1
645: #else
646: #define TYPE_LONGLONG 0
647: #endif
648: #ifdef __cplusplus
649: #define TYPE_BOOL 1
650: #else
651: #define TYPE_BOOL 0
652: #endif
653:
654:
655: #define forCarbon 1
656:
657:
658: #elif defined(__GNUC__) && defined(__linux__)
659: /*
660: gcc (egcs, really) for MkLinux. << WARNING: Unsupported Compiler >>
661: */
662: #if #cpu(powerpc)
663: #define TARGET_CPU_PPC 1
664: #define TARGET_CPU_68K 0
665: #define TARGET_CPU_X86 0
666: #define TARGET_CPU_MIPS 0
667: #define TARGET_CPU_SPARC 0
668: #define TARGET_CPU_ALPHA 0
669: #define TARGET_RT_MAC_CFM 1
670: #define TARGET_RT_MAC_68881 0
671: #elif #cpu(m68k)
672: #define TARGET_CPU_PPC 0
673: #define TARGET_CPU_68K 1
674: #define TARGET_CPU_X86 0
675: #define TARGET_CPU_MIPS 0
676: #define TARGET_CPU_SPARC 0
677: #define TARGET_CPU_ALPHA 0
678: #define TARGET_RT_MAC_CFM 0
679: #define TARGET_RT_MAC_68881 0
680: #else
681: #error unsupported GNU C compiler
682: #endif
683:
684: #if #system(macos)
685: #define TARGET_OS_MAC 1
686: #define TARGET_OS_WIN32 0
687: #define TARGET_OS_UNIX 0
688: #elif #system(unix)
689: #define TARGET_OS_MAC 0
690: #define TARGET_OS_WIN32 0
691: #define TARGET_OS_UNIX 1
692: #else
693: #error unsupported GNU C compiler
694: #endif
695:
696:
697:
698: #define TARGET_RT_LITTLE_ENDIAN 0
699: #define TARGET_RT_BIG_ENDIAN 1
700: #define PRAGMA_IMPORT 0
701: #define PRAGMA_STRUCT_ALIGN 0
702: #define PRAGMA_ONCE 0
703: #define PRAGMA_STRUCT_PACK 1
704: #define PRAGMA_STRUCT_PACKPUSH 0
705: #define PRAGMA_ENUM_PACK 0
706: #define PRAGMA_ENUM_ALWAYSINT 0
707: #define PRAGMA_ENUM_OPTIONS 0
708: #define FOUR_CHAR_CODE(x) (x)
709:
710: #define TYPE_EXTENDED 0
711: #ifdef _LONG_LONG
712: #define TYPE_LONGLONG 1
713: #else
714: #define TYPE_LONGLONG 0
715: #endif
716: #define TYPE_BOOL 0
717:
718:
719: #elif defined(__GNUC__)
720: /*
721: gC for MPW from Free Software Foundation, Inc.
722: */
723: #if #cpu(powerpc)
724: #define TARGET_CPU_PPC 1
725: #define TARGET_CPU_68K 0
726: #define TARGET_CPU_X86 0
727: #define TARGET_CPU_MIPS 0
728: #define TARGET_CPU_SPARC 0
729: #define TARGET_CPU_ALPHA 0
730: #define TARGET_RT_MAC_CFM 1
731: #define TARGET_RT_MAC_68881 0
732: #elif #cpu(m68k)
733: #define TARGET_CPU_PPC 0
734: #define TARGET_CPU_68K 1
735: #define TARGET_CPU_X86 0
736: #define TARGET_CPU_MIPS 0
737: #define TARGET_CPU_SPARC 0
738: #define TARGET_CPU_ALPHA 0
739: #define TARGET_RT_MAC_CFM 0
740: #define TARGET_RT_MAC_68881 0
741: #else
742: #error unsupported GNU C compiler
743: #endif
744:
745: #if #system(macos)
746: #define TARGET_OS_MAC 1
747: #define TARGET_OS_WIN32 0
748: #define TARGET_OS_UNIX 0
749: #elif #system(unix)
750: #define TARGET_OS_MAC 0
751: #define TARGET_OS_WIN32 0
752: #define TARGET_OS_UNIX 1
753: #else
754: #error unsupported GNU C compiler
755: #endif
756:
757: #define TARGET_RT_LITTLE_ENDIAN 0
758: #define TARGET_RT_BIG_ENDIAN 1
759: #define PRAGMA_IMPORT 0
760: #define PRAGMA_STRUCT_ALIGN 1
761: #define PRAGMA_ONCE 0
762: #define PRAGMA_STRUCT_PACK 0
763: #define PRAGMA_STRUCT_PACKPUSH 0
764: #define PRAGMA_ENUM_PACK 0
765: #define PRAGMA_ENUM_ALWAYSINT 0
766: #define PRAGMA_ENUM_OPTIONS 0
767: #define FOUR_CHAR_CODE(x) (x)
768:
769: #define TYPE_EXTENDED 0
770: #ifdef _LONG_LONG
771: #define TYPE_LONGLONG 1
772: #else
773: #define TYPE_LONGLONG 0
774: #endif
775: #define TYPE_BOOL 0
776:
777:
778:
779: #elif defined(__xlc) || defined(__xlC) || defined(__xlC__) || defined(__XLC121__)
780: /*
781: xlc and xlC on RS/6000 from IBM, Inc.
782: */
783: #define TARGET_CPU_PPC 1
784: #define TARGET_CPU_68K 0
785: #define TARGET_CPU_X86 0
786: #define TARGET_CPU_MIPS 0
787: #define TARGET_CPU_SPARC 0
788: #define TARGET_CPU_ALPHA 0
789: #if defined(_AIX)
790: #define TARGET_OS_MAC 0
791: #define TARGET_OS_UNIX 1
792: #else
793: #define TARGET_OS_MAC 1
794: #define TARGET_OS_UNIX 0
795: #endif
796: #define TARGET_OS_WIN32 0
797: #define TARGET_RT_LITTLE_ENDIAN 0
798: #define TARGET_RT_BIG_ENDIAN 1
799: #define TARGET_RT_MAC_CFM 1
800: #define TARGET_RT_MAC_68881 0
801: #define PRAGMA_IMPORT 0
802: #define PRAGMA_STRUCT_ALIGN 1
803: #define PRAGMA_ONCE 0
804: #define PRAGMA_STRUCT_PACK 0
805: #define PRAGMA_STRUCT_PACKPUSH 0
806: #define PRAGMA_ENUM_PACK 0
807: #define PRAGMA_ENUM_ALWAYSINT 0
808: #define PRAGMA_ENUM_OPTIONS 1
809: #define FOUR_CHAR_CODE(x) (x)
810:
811: #define TYPE_EXTENDED 0
812: #ifdef _LONG_LONG
813: #define TYPE_LONGLONG 1
814: #else
815: #define TYPE_LONGLONG 0
816: #endif
817: #define TYPE_BOOL 0
818:
819:
820: #elif defined(_MSC_VER) && !defined(__MWERKS__)
821: /*
822: Visual C++ from Microsoft, Inc.
823: */
824: #if defined(_M_M68K) /* Visual C++ with Macintosh 68K target */
825: #define TARGET_CPU_PPC 0
826: #define TARGET_CPU_68K 1
827: #define TARGET_CPU_X86 0
828: #define TARGET_CPU_MIPS 0
829: #define TARGET_CPU_SPARC 0
830: #define TARGET_CPU_ALPHA 0
831: #define TARGET_OS_MAC 1
832: #define TARGET_OS_WIN32 0
833: #define TARGET_OS_UNIX 0
834: #define TARGET_RT_LITTLE_ENDIAN 0
835: #define TARGET_RT_BIG_ENDIAN 1
836: #define TARGET_RT_MAC_CFM 0
837: #define TARGET_RT_MAC_68881 0
838: #define PRAGMA_IMPORT 0
839: #define PRAGMA_STRUCT_ALIGN 1
840: #define PRAGMA_ONCE 0
841: #define PRAGMA_STRUCT_PACK 1
842: #define PRAGMA_STRUCT_PACKPUSH 1
843: #define PRAGMA_ENUM_PACK 0
844: #define PRAGMA_ENUM_ALWAYSINT 0
845: #define PRAGMA_ENUM_OPTIONS 0
846: #define FOUR_CHAR_CODE(x) (x)
847: #define TYPE_EXTENDED 0
848: #define TYPE_LONGLONG 0
849: #define TYPE_BOOL 0
850: #elif defined(_M_MPPC) /* Visual C++ with Macintosh PowerPC target */
851: #define TARGET_CPU_PPC 1
852: #define TARGET_CPU_68K 0
853: #define TARGET_CPU_X86 0
854: #define TARGET_CPU_MIPS 0
855: #define TARGET_CPU_SPARC 0
856: #define TARGET_CPU_ALPHA 0
857: #define TARGET_OS_MAC 1
858: #define TARGET_OS_WIN32 0
859: #define TARGET_OS_UNIX 0
860: #define TARGET_RT_LITTLE_ENDIAN 0
861: #define TARGET_RT_BIG_ENDIAN 1
862: #define TARGET_RT_MAC_CFM 1
863: #define TARGET_RT_MAC_68881 0
864: #define PRAGMA_IMPORT 0
865: #define PRAGMA_STRUCT_ALIGN 1
866: #define PRAGMA_ONCE 0
867: #define PRAGMA_STRUCT_PACK 1
868: #define PRAGMA_STRUCT_PACKPUSH 1
869: #define PRAGMA_ENUM_PACK 0
870: #define PRAGMA_ENUM_ALWAYSINT 0
871: #define PRAGMA_ENUM_OPTIONS 0
872: #define FOUR_CHAR_CODE(x) (x)
873: #define TYPE_EXTENDED 0
874: #define TYPE_LONGLONG 0
875: #define TYPE_BOOL 0
876:
877: #elif defined(_M_IX86) /* Visual C++ with Intel x86 target */
878: #define TARGET_CPU_PPC 0
879: #define TARGET_CPU_68K 0
880: #define TARGET_CPU_X86 1
881: #define TARGET_CPU_MIPS 0
882: #define TARGET_CPU_SPARC 0
883: #define TARGET_CPU_ALPHA 0
884: #define TARGET_OS_MAC 0
885: #define TARGET_OS_WIN32 1
886: #define TARGET_OS_UNIX 0
887: #define TARGET_RT_LITTLE_ENDIAN 1
888: #define TARGET_RT_BIG_ENDIAN 0
889: #define TARGET_RT_MAC_CFM 0
890: #define TARGET_RT_MAC_68881 0
891: #define PRAGMA_IMPORT 0
892: #define PRAGMA_STRUCT_ALIGN 0
893: #define PRAGMA_ONCE 0
894: #define PRAGMA_STRUCT_PACK 1
895: #define PRAGMA_STRUCT_PACKPUSH 1
896: #define PRAGMA_ENUM_PACK 0
897: #define PRAGMA_ENUM_ALWAYSINT 0
898: #define PRAGMA_ENUM_OPTIONS 0
899: #define FOUR_CHAR_CODE(x) (x)
900: #define TYPE_EXTENDED 0
901: #define TYPE_LONGLONG 0
902: #if defined(__cplusplus) && (_MSC_VER >= 1100)
903: #define TYPE_BOOL 1
904: #else
905: #define TYPE_BOOL 0
906: #endif
907:
908: #elif defined(_M_ALPHA) /* Visual C++ with Dec Alpha target */
909: #define TARGET_CPU_PPC 0
910: #define TARGET_CPU_68K 0
911: #define TARGET_CPU_X86 0
912: #define TARGET_CPU_MIPS 0
913: #define TARGET_CPU_SPARC 0
914: #define TARGET_CPU_ALPHA 1
915: #define TARGET_OS_MAC 0
916: #define TARGET_OS_WIN32 1
917: #define TARGET_OS_UNIX 0
918: #define TARGET_RT_LITTLE_ENDIAN 1
919: #define TARGET_RT_BIG_ENDIAN 0
920: #define TARGET_RT_MAC_CFM 0
921: #define TARGET_RT_MAC_68881 0
922: #define PRAGMA_IMPORT 0
923: #define PRAGMA_STRUCT_ALIGN 0
924: #define PRAGMA_ONCE 0
925: #define PRAGMA_STRUCT_PACK 1
926: #define PRAGMA_STRUCT_PACKPUSH 1
927: #define PRAGMA_ENUM_PACK 0
928: #define PRAGMA_ENUM_ALWAYSINT 0
929: #define PRAGMA_ENUM_OPTIONS 0
930: #define FOUR_CHAR_CODE(x) (((unsigned long) ((x) & 0x000000FF)) << 24) \
931: | (((unsigned long) ((x) & 0x0000FF00)) << 8) \
932: | (((unsigned long) ((x) & 0x00FF0000)) >> 8) \
933: | (((unsigned long) ((x) & 0xFF000000)) >> 24)
934: #define TYPE_EXTENDED 0
935: #define TYPE_LONGLONG 0
936: #define TYPE_BOOL 0
937:
938: #elif defined(_M_PPC) /* Visual C++ for Windows NT on PowerPC target */
939: #define TARGET_CPU_PPC 1
940: #define TARGET_CPU_68K 0
941: #define TARGET_CPU_X86 0
942: #define TARGET_CPU_MIPS 0
943: #define TARGET_CPU_SPARC 0
944: #define TARGET_CPU_ALPHA 0
945: #define TARGET_OS_MAC 0
946: #define TARGET_OS_WIN32 1
947: #define TARGET_OS_UNIX 0
948: #define TARGET_RT_LITTLE_ENDIAN 1
949: #define TARGET_RT_BIG_ENDIAN 0
950: #define TARGET_RT_MAC_CFM 0
951: #define TARGET_RT_MAC_68881 0
952: #define PRAGMA_IMPORT 0
953: #define PRAGMA_STRUCT_ALIGN 0
954: #define PRAGMA_ONCE 0
955: #define PRAGMA_STRUCT_PACK 1
956: #define PRAGMA_STRUCT_PACKPUSH 1
957: #define PRAGMA_ENUM_PACK 0
958: #define PRAGMA_ENUM_ALWAYSINT 0
959: #define PRAGMA_ENUM_OPTIONS 0
960: #define FOUR_CHAR_CODE(x) (((unsigned long) ((x) & 0x000000FF)) << 24) \
961: | (((unsigned long) ((x) & 0x0000FF00)) << 8) \
962: | (((unsigned long) ((x) & 0x00FF0000)) >> 8) \
963: | (((unsigned long) ((x) & 0xFF000000)) >> 24)
964: #define TYPE_EXTENDED 0
965: #define TYPE_LONGLONG 0
966: #define TYPE_BOOL 0
967:
968: #elif defined(_M_MRX000) /* Visual C++ for Windows NT on MIPS target */
969: #define TARGET_CPU_PPC 0
970: #define TARGET_CPU_68K 0
971: #define TARGET_CPU_X86 0
972: #define TARGET_CPU_MIPS 1
973: #define TARGET_CPU_SPARC 0
974: #define TARGET_CPU_ALPHA 0
975: #define TARGET_OS_MAC 0
976: #define TARGET_OS_WIN32 1
977: #define TARGET_OS_UNIX 0
978: #define TARGET_RT_LITTLE_ENDIAN 1
979: #define TARGET_RT_BIG_ENDIAN 0
980: #define TARGET_RT_MAC_CFM 0
981: #define TARGET_RT_MAC_68881 0
982: #define PRAGMA_IMPORT 0
983: #define PRAGMA_STRUCT_ALIGN 0
984: #define PRAGMA_ONCE 0
985: #define PRAGMA_STRUCT_PACK 1
986: #define PRAGMA_STRUCT_PACKPUSH 1
987: #define PRAGMA_ENUM_PACK 0
988: #define PRAGMA_ENUM_ALWAYSINT 0
989: #define PRAGMA_ENUM_OPTIONS 0
990: #define FOUR_CHAR_CODE(x) (((unsigned long) ((x) & 0x000000FF)) << 24) \
991: | (((unsigned long) ((x) & 0x0000FF00)) << 8) \
992: | (((unsigned long) ((x) & 0x00FF0000)) >> 8) \
993: | (((unsigned long) ((x) & 0xFF000000)) >> 24)
994: #define TYPE_EXTENDED 0
995: #define TYPE_LONGLONG 0
996: #define TYPE_BOOL 0
997: #endif
998:
999:
1000: #elif defined(__MOTO__)
1001: /*
1002: mcc from Motorola, Inc.
1003: */
1004: #define TARGET_CPU_PPC 1
1005: #define TARGET_CPU_68K 0
1006: #define TARGET_CPU_X86 0
1007: #define TARGET_CPU_MIPS 0
1008: #define TARGET_CPU_SPARC 0
1009: #define TARGET_CPU_ALPHA 0
1010: #define TARGET_OS_MAC 1
1011: #define TARGET_OS_WIN32 0
1012: #define TARGET_OS_UNIX 0
1013: #define TARGET_RT_LITTLE_ENDIAN 0
1014: #define TARGET_RT_BIG_ENDIAN 1
1015: #define TARGET_RT_MAC_CFM 1
1016: #define TARGET_RT_MAC_68881 0
1017: #define PRAGMA_IMPORT 0 /* how is this detected ?? */
1018: #define PRAGMA_STRUCT_ALIGN 1
1019: #if __MOTO__ >= 40702 /* MCC version 4.7.2 */
1020: #define PRAGMA_ONCE 1
1021: #else
1022: #define PRAGMA_ONCE 0
1023: #endif
1024: #define PRAGMA_STRUCT_PACK 0
1025: #define PRAGMA_STRUCT_PACKPUSH 0
1026: #define PRAGMA_ENUM_PACK 0
1027: #define PRAGMA_ENUM_ALWAYSINT 0
1028: #define PRAGMA_ENUM_OPTIONS 0
1029: #define FOUR_CHAR_CODE(x) (x)
1030: #define TYPE_LONGLONG 0 /* how is this detected ?? */
1031: #ifdef _BOOL
1032: #define TYPE_BOOL 1
1033: #else
1034: #define TYPE_BOOL 0
1035: #endif
1036: #define TYPE_EXTENDED 0
1037:
1038:
1039:
1040: #elif defined(_MIPS_ISA)
1041: /*
1042: MIPSpro compiler from Silicon Graphics Inc.
1043: */
1044: #define TARGET_CPU_PPC 0
1045: #define TARGET_CPU_68K 0
1046: #define TARGET_CPU_X86 0
1047: #define TARGET_CPU_MIPS 1
1048: #define TARGET_CPU_SPARC 0
1049: #define TARGET_CPU_ALPHA 0
1050: #define TARGET_OS_MAC 0
1051: #define TARGET_OS_WIN32 0
1052: #define TARGET_OS_UNIX 1
1053: #define TARGET_RT_LITTLE_ENDIAN 0
1054: #define TARGET_RT_BIG_ENDIAN 1
1055: #define TARGET_RT_MAC_CFM 0
1056: #define TARGET_RT_MAC_68881 0
1057: #define PRAGMA_IMPORT 0
1058: #define PRAGMA_STRUCT_ALIGN 0
1059: #define PRAGMA_ONCE 0
1060: #define PRAGMA_STRUCT_PACK 1
1061: #define PRAGMA_STRUCT_PACKPUSH 0
1062: #define PRAGMA_ENUM_PACK 0
1063: #define PRAGMA_ENUM_ALWAYSINT 0
1064: #define PRAGMA_ENUM_OPTIONS 0
1065: #define FOUR_CHAR_CODE(x) (x)
1066: #define TYPE_EXTENDED 0
1067: #define TYPE_LONGLONG 0
1068: #define TYPE_BOOL 0
1069:
1070:
1071: #elif defined(__sparc)
1072: /*
1073: SPARCompiler compiler from Sun Microsystems Inc.
1074: */
1075: #define TARGET_CPU_PPC 0
1076: #define TARGET_CPU_68K 0
1077: #define TARGET_CPU_X86 0
1078: #define TARGET_CPU_MIPS 0
1079: #define TARGET_CPU_SPARC 1
1080: #define TARGET_CPU_ALPHA 0
1081: #define TARGET_OS_MAC 0
1082: #define TARGET_OS_WIN32 0
1083: #define TARGET_OS_UNIX 1
1084: #define TARGET_RT_LITTLE_ENDIAN 0
1085: #define TARGET_RT_BIG_ENDIAN 1
1086: #define TARGET_RT_MAC_CFM 0
1087: #define TARGET_RT_MAC_68881 0
1088: #define PRAGMA_IMPORT 0
1089: #define PRAGMA_STRUCT_ALIGN 0
1090: #define PRAGMA_ONCE 0
1091: #define PRAGMA_STRUCT_PACK 1
1092: #define PRAGMA_STRUCT_PACKPUSH 0
1093: #define PRAGMA_ENUM_PACK 0
1094: #define PRAGMA_ENUM_ALWAYSINT 0
1095: #define PRAGMA_ENUM_OPTIONS 0
1096: #define FOUR_CHAR_CODE(x) (((unsigned long) ((x) & 0x000000FF)) << 24) \
1097: | (((unsigned long) ((x) & 0x0000FF00)) << 8) \
1098: | (((unsigned long) ((x) & 0x00FF0000)) >> 8) \
1099: | (((unsigned long) ((x) & 0xFF000000)) >> 24)
1100: #define TYPE_EXTENDED 0
1101: #define TYPE_LONGLONG 0
1102: #define TYPE_BOOL 0
1103:
1104:
1105: #else
1106: /*
1107: Unknown compiler, perhaps set up from the command line (e.g. -d TARGET_CPU_MIPS , etc.)
1108: */
1109: #if defined(TARGET_CPU_PPC) && TARGET_CPU_PPC
1110: #define TARGET_CPU_68K 0
1111: #define TARGET_CPU_X86 0
1112: #define TARGET_CPU_MIPS 0
1113: #define TARGET_CPU_SPARC 0
1114: #define TARGET_CPU_ALPHA 0
1115: #elif defined(TARGET_CPU_68K) && TARGET_CPU_68K
1116: #define TARGET_CPU_PPC 0
1117: #define TARGET_CPU_X86 0
1118: #define TARGET_CPU_MIPS 0
1119: #define TARGET_CPU_SPARC 0
1120: #define TARGET_CPU_ALPHA 0
1121: #elif defined(TARGET_CPU_X86) && TARGET_CPU_X86
1122: #define TARGET_CPU_PPC 0
1123: #define TARGET_CPU_68K 0
1124: #define TARGET_CPU_MIPS 0
1125: #define TARGET_CPU_SPARC 0
1126: #define TARGET_CPU_ALPHA 0
1127: #elif defined(TARGET_CPU_MIPS) && TARGET_CPU_MIPS
1128: #define TARGET_CPU_PPC 0
1129: #define TARGET_CPU_68K 0
1130: #define TARGET_CPU_X86 0
1131: #define TARGET_CPU_SPARC 0
1132: #define TARGET_CPU_ALPHA 0
1133: #elif defined(TARGET_CPU_SPARC) && TARGET_CPU_SPARC
1134: #define TARGET_CPU_PPC 0
1135: #define TARGET_CPU_68K 0
1136: #define TARGET_CPU_X86 0
1137: #define TARGET_CPU_MIPS 0
1138: #define TARGET_CPU_ALPHA 0
1139: #elif defined(TARGET_CPU_ALPHA) && TARGET_CPU_ALPHA
1140: #define TARGET_CPU_PPC 0
1141: #define TARGET_CPU_68K 0
1142: #define TARGET_CPU_X86 0
1143: #define TARGET_CPU_MIPS 0
1144: #define TARGET_CPU_SPARC 0
1145:
1146:
1147: #else
1148: /*
1149: NOTE: If your compiler errors out here then support for your compiler
1150: has not yet been added to ConditionalMacros.h.
1151:
1152: ConditionalMacros.h is designed to be plug-and-play. It auto detects
1153: which compiler is being run and configures the TARGET_ conditionals
1154: appropriately.
1155:
1156: The short term work around is to set the TARGET_CPU_ and TARGET_OS_
1157: on the command line to the compiler (e.g. d TARGET_CPU_MIPS -d TARGET_OS_UNIX)
1158:
1159: The long term solution is to add a new case to this file which
1160: auto detects your compiler and sets up the TARGET_ conditionals.
1161: If you do this, send the changes you made to [email protected]
1162: to get it integrated into the next release of ConditionalMacros.h.
1163: */
1164: #error ConditionalMacros.h: unknown compiler (see comment above)
1165: #define TARGET_CPU_PPC 0
1166: #define TARGET_CPU_68K 0
1167: #define TARGET_CPU_X86 0
1168: #define TARGET_CPU_MIPS 0
1169: #define TARGET_CPU_SPARC 0
1170: #define TARGET_CPU_ALPHA 0
1171: #endif
1172:
1173:
1174:
1175: #if defined(TARGET_OS_MAC) && TARGET_OS_MAC
1176: #define TARGET_OS_WIN32 0
1177: #define TARGET_OS_UNIX 0
1178: #elif defined(TARGET_OS_WIN32) && TARGET_OS_WIN32
1179: #define TARGET_OS_MAC 0
1180: #define TARGET_OS_UNIX 0
1181: #elif defined(TARGET_OS_UNIX) && TARGET_OS_UNIX
1182: #define TARGET_OS_MAC 0
1183: #define TARGET_OS_WIN32 0
1184: #elif TARGET_CPU_PPC || TARGET_CPU_68K
1185: #define TARGET_OS_MAC 1
1186: #define TARGET_OS_WIN32 0
1187: #define TARGET_OS_UNIX 0
1188: #else
1189: #error ConditionalMacros.h: unknown target OS (see comment above)
1190: #endif
1191:
1192: #if !defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
1193: #if TARGET_OS_MAC
1194: #define TARGET_RT_LITTLE_ENDIAN 0
1195: #define TARGET_RT_BIG_ENDIAN 1
1196: #elif TARGET_OS_WIN32
1197: #define TARGET_RT_LITTLE_ENDIAN 1
1198: #define TARGET_RT_BIG_ENDIAN 0
1199: #endif
1200: #endif
1201:
1202: #if defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
1203: #define TARGET_RT_LITTLE_ENDIAN !TARGET_RT_BIG_ENDIAN
1204: #elif !defined(TARGET_RT_BIG_ENDIAN) && defined(TARGET_RT_LITTLE_ENDIAN)
1205: #define TARGET_RT_BIG_ENDIAN !TARGET_RT_LITTLE_ENDIAN
1206: #endif
1207:
1208: #if !defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
1209: #error unknown endianess of target processor
1210: #endif
1211:
1212: #ifndef TARGET_RT_MAC_CFM
1213: #define TARGET_RT_MAC_CFM TARGET_CPU_PPC
1214: #endif
1215: #ifndef TARGET_RT_MAC_68881
1216: #define TARGET_RT_MAC_68881 0
1217: #endif
1218:
1219:
1220: #ifndef PRAGMA_IMPORT
1221: #define PRAGMA_IMPORT 0
1222: #endif
1223: #ifndef PRAGMA_STRUCT_ALIGN
1224: #define PRAGMA_STRUCT_ALIGN 0
1225: #endif
1226: #ifndef PRAGMA_ONCE
1227: #define PRAGMA_ONCE 0
1228: #endif
1229: #ifndef PRAGMA_STRUCT_PACK
1230: #define PRAGMA_STRUCT_PACK 0
1231: #endif
1232: #ifndef PRAGMA_STRUCT_PACKPUSH
1233: #define PRAGMA_STRUCT_PACKPUSH 0
1234: #endif
1235: #ifndef PRAGMA_ENUM_PACK
1236: #define PRAGMA_ENUM_PACK 0
1237: #endif
1238: #ifndef PRAGMA_ENUM_ALWAYSINT
1239: #define PRAGMA_ENUM_ALWAYSINT 0
1240: #endif
1241: #ifndef PRAGMA_ENUM_OPTIONS
1242: #define PRAGMA_ENUM_OPTIONS 0
1243: #endif
1244: #ifndef FOUR_CHAR_CODE
1245: #define FOUR_CHAR_CODE(x) (x)
1246: #endif
1247:
1248: #ifndef TYPE_EXTENDED
1249: #define TYPE_EXTENDED 0
1250: #endif
1251: #ifndef TYPE_LONGLONG
1252: #define TYPE_LONGLONG 0
1253: #endif
1254: #ifndef TYPE_BOOL
1255: #define TYPE_BOOL 0
1256: #endif
1257: #endif
1258:
1259:
1260:
1261:
1262: /****************************************************************************************************
1263:
1264: EXTERN_API�
1265: These conditionals are used to specify the calling convention of a function.
1266: Mac classic 68K and Win32 each have two possible calling conventions:
1267:
1268: EXTERN_API - Classic 68K pascal, Win32 __cdecl
1269: EXTERN_API_C - Classic 68K C, Win32 __cdecl
1270: EXTERN_API_STDCALL - Classic 68K pascal, Win32 __stdcall
1271: EXTERN_API_C_STDCALL - Classic 68K C, Win32 __stdcall
1272:
1273:
1274: CALLBACK_API�
1275: These conditionals are used to specify the calling convention of a function pointer.
1276: Mac classic 68K and Win32 each have two possible calling conventions:
1277:
1278: CALLBACK_API - Classic 68K pascal, Win32 __stdcall
1279: CALLBACK_API_C - Classic 68K C, Win32 __stdcall
1280: CALLBACK_API_STDCALL - Classic 68K pascal, Win32 __cdecl
1281: CALLBACK_API_C_STDCALL - Classic 68K C, Win32 __cdecl
1282:
1283: ****************************************************************************************************/
1284: #if TARGET_OS_MAC
1285: /*
1286: Mac OS
1287: */
1288: #define EXTERN_API(_type) extern pascal _type /* Note: all Mac OS compilers must be able to handle the pascal keyword */
1289: #define EXTERN_API_C(_type) extern _type
1290: #define EXTERN_API_STDCALL(_type) extern pascal _type
1291: #define EXTERN_API_C_STDCALL(_type) extern _type
1292: #define CALLBACK_API(_type, _name) pascal _type (*_name)
1293: #define CALLBACK_API_C(_type, _name) _type (*_name)
1294: #define CALLBACK_API_STDCALL(_type, _name) pascal _type (*_name)
1295: #define CALLBACK_API_C_STDCALL(_type, _name) _type (*_name)
1296: #elif TARGET_OS_WIN32
1297: /*
1298: Win32
1299: */
1300: #define EXTERN_API(_type) _type __cdecl
1301: #define EXTERN_API_C(_type) _type __cdecl
1302: #define EXTERN_API_STDCALL(_type) _type __stdcall
1303: #define EXTERN_API_C_STDCALL(_type) _type __stdcall
1304: #define CALLBACK_API(_type, _name) _type (__cdecl * _name)
1305: #define CALLBACK_API_C(_type, _name) _type (__cdecl * _name)
1306: #define CALLBACK_API_STDCALL(_type, _name) _type (__stdcall * _name)
1307: #define CALLBACK_API_C_STDCALL(_type, _name) _type (__stdcall * _name)
1308: /* MacOS 68K compilers need pascal keyword on function implementation, but Win32 cannot have it */
1309: #undef pascal
1310: #define pascal
1311: #else
1312: /*
1313: Unix or anything else
1314: */
1315: #define EXTERN_API(_type) extern _type
1316: #define EXTERN_API_C(_type) extern _type
1317: #define EXTERN_API_STDCALL(_type) extern _type
1318: #define EXTERN_API_C_STDCALL(_type) extern _type
1319: #define CALLBACK_API(_type, _name) _type (*_name)
1320: #define CALLBACK_API_C(_type, _name) _type (*_name)
1321: #define CALLBACK_API_STDCALL(_type, _name) _type (*_name)
1322: #define CALLBACK_API_C_STDCALL(_type, _name) _type (*_name)
1323: /* MacOS 68K compilers need pascal keyword on function implementation, but unix cannot have it */
1324: #undef pascal
1325: #define pascal
1326: #endif
1327:
1328:
1329: /* Backwards compatibility for clients expecting Universal Interfacew 3.0d7 (Interfacer 2.d014) style */
1330: #define EXTERN_API_1 EXTERN_API_STDCALL
1331: #define EXTERN_API_2 EXTERN_API_C_STDCALL
1332: #define EXTERN_API_3 EXTERN_API
1333: #define EXTERN_API_4 EXTERN_API_C
1334: #define CALLBACK_API_1 CALLBACK_API_STDCALL
1335: #define CALLBACK_API_2 CALLBACK_API_C_STDCALL
1336: #define CALLBACK_API_3 CALLBACK_API
1337: #define CALLBACK_API_4 CALLBACK_API_C
1338:
1339: /****************************************************************************************************
1340: Backward compatibility for clients expecting 2.x version on ConditionalMacros.h
1341:
1342: GENERATINGPOWERPC - Compiler is generating PowerPC instructions
1343: GENERATING68K - Compiler is generating 68k family instructions
1344: GENERATING68881 - Compiler is generating mc68881 floating point instructions
1345: GENERATINGCFM - Code being generated assumes CFM calling conventions
1346: CFMSYSTEMCALLS - No A-traps. Systems calls are made using CFM and UPP's
1347: PRAGMA_ALIGN_SUPPORTED - Compiler supports: #pragma options align=mac68k/power/reset
1348: PRAGMA_IMPORT_SUPPORTED - Compiler supports: #pragma import on/off/reset
1349:
1350: ****************************************************************************************************/
1351: #if TARGET_OS_MAC
1352: #define GENERATINGPOWERPC TARGET_CPU_PPC
1353: #define GENERATING68K TARGET_CPU_68K
1354: #define GENERATING68881 TARGET_RT_MAC_68881
1355: #define GENERATINGCFM TARGET_RT_MAC_CFM
1356: #define CFMSYSTEMCALLS TARGET_RT_MAC_CFM
1357: #define PRAGMA_ALIGN_SUPPORTED PRAGMA_STRUCT_ALIGN
1358: #define PRAGMA_IMPORT_SUPPORTED PRAGMA_IMPORT
1359: /*
1360: NOTE: The FOR_� conditionals were developed to produce integerated
1361: interface files for System 7 and Copland. Now that Copland
1362: is canceled, all FOR_ conditionals have been removed from
1363: the interface files. But, just in case you someone got an
1364: interface file that uses them, the following sets the FOR_�
1365: conditionals to a consistent, usable state.
1366:
1367: #define FOR_OPAQUE_SYSTEM_DATA_STRUCTURES 0
1368: #ifndef FOR_PTR_BASED_AE
1369: #define FOR_PTR_BASED_AE 0
1370: #endif
1371: #define FOR_SYSTEM7_ONLY 1
1372: #define FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED 1
1373: #define FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE 1
1374: #define FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE 1
1375: #define FOR_SYSTEM8_COOPERATIVE 0
1376: #define FOR_SYSTEM8_PREEMPTIVE 0
1377: */
1378: #define FOR_OPAQUE_SYSTEM_DATA_STRUCTURES ..FOR_OPAQUE_SYSTEM_DATA_STRUCTURES_is_an_obsolete_Coplandism..
1379: #define FOR_PTR_BASED_AE ..FOR_PTR_BASED_AE_is_an_obsolete_Coplandism..
1380: #define FOR_SYSTEM7_ONLY ..FOR_SYSTEM7_ONLY_is_an_obsolete_Coplandism..
1381: #define FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED ..FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED_is_an_obsolete_Coplandism..
1382: #define FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE ..FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE_is_an_obsolete_Coplandism..
1383: #define FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE ..FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE_is_an_obsolete_Coplandism..
1384: #define FOR_SYSTEM8_COOPERATIVE ..FOR_SYSTEM8_COOPERATIVE_is_an_obsolete_Coplandism..
1385: #define FOR_SYSTEM8_PREEMPTIVE ..FOR_SYSTEM8_PREEMPTIVE_is_an_obsolete_Coplandism..
1386: #endif /* TARGET_OS_MAC */
1387:
1388:
1389:
1390: /****************************************************************************************************
1391:
1392: OLDROUTINENAMES - "Old" names for Macintosh system calls are allowed in source code.
1393: (e.g. DisposPtr instead of DisposePtr). The names of system routine
1394: are now more sensitive to change because CFM binds by name. In the
1395: past, system routine names were compiled out to just an A-Trap.
1396: Macros have been added that each map an old name to its new name.
1397: This allows old routine names to be used in existing source files,
1398: but the macros only work if OLDROUTINENAMES is true. This support
1399: will be removed in the near future. Thus, all source code should
1400: be changed to use the new names! You can set OLDROUTINENAMES to false
1401: to see if your code has any old names left in it.
1402:
1403: OLDROUTINELOCATIONS - "Old" location of Macintosh system calls are used. For example, c2pstr
1404: has been moved from Strings to TextUtils. It is conditionalized in
1405: Strings with OLDROUTINELOCATIONS and in TextUtils with !OLDROUTINELOCATIONS.
1406: This allows developers to upgrade to newer interface files without
1407: having to change the includes in their source code. But, it allows
1408: the slow migration of system calls to more understandable file locations.
1409: OLDROUTINELOCATIONS currently defaults to true, but eventually will
1410: default to false.
1411:
1412: ****************************************************************************************************/
1413: #ifndef OLDROUTINENAMES
1414: #define OLDROUTINENAMES 0
1415: #endif /* !defined(OLDROUTINENAMES) */
1416:
1417: #ifndef OLDROUTINELOCATIONS
1418: #define OLDROUTINELOCATIONS 0
1419: #endif /* !defined(OLDROUTINELOCATIONS) */
1420:
1421:
1422:
1423: /****************************************************************************************************
1424: C specific conditionals
1425:
1426: CGLUESUPPORTED - Interface library will support "C glue" functions (function names
1427: are: all lowercase, use C strings instead of pascal strings, use
1428: Point* instead of Point).
1429:
1430: ****************************************************************************************************/
1431: #ifndef CGLUESUPPORTED
1432: #if TARGET_OS_MAC && !defined(THINK_C)
1433: #define CGLUESUPPORTED 1
1434: #else
1435: #define CGLUESUPPORTED 0
1436: #endif /* TARGET_OS_MAC && !defined(THINK_C) */
1437:
1438: #endif /* !defined(CGLUESUPPORTED) */
1439:
1440:
1441:
1442: /****************************************************************************************************
1443: The following macros isolate the use of 68K inlines in function prototypes.
1444: On the Mac OS under the Classic 68K runtime, function prototypes were followed
1445: by a list of 68K opcodes which the compiler inserted in the generated code instead
1446: of a JSR. Under Classic 68K on the Mac OS, this macro will put the opcodes
1447: in the right syntax. For all other OS's and runtimes the macro suppress the opcodes.
1448: Example:
1449:
1450: EXTERN_P void DrawPicture(PicHandle myPicture, const Rect *dstRect)
1451: ONEWORDINLINE(0xA8F6);
1452:
1453: ****************************************************************************************************/
1454:
1455: #if TARGET_OS_MAC && !TARGET_RT_MAC_CFM
1456: #define ONEWORDINLINE(w1) = w1
1457: #define TWOWORDINLINE(w1,w2) = {w1,w2}
1458: #define THREEWORDINLINE(w1,w2,w3) = {w1,w2,w3}
1459: #define FOURWORDINLINE(w1,w2,w3,w4) = {w1,w2,w3,w4}
1460: #define FIVEWORDINLINE(w1,w2,w3,w4,w5) = {w1,w2,w3,w4,w5}
1461: #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6) = {w1,w2,w3,w4,w5,w6}
1462: #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7) = {w1,w2,w3,w4,w5,w6,w7}
1463: #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8) = {w1,w2,w3,w4,w5,w6,w7,w8}
1464: #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9) = {w1,w2,w3,w4,w5,w6,w7,w8,w9}
1465: #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10) = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10}
1466: #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11) = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11}
1467: #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}
1468: #else
1469: #define ONEWORDINLINE(w1)
1470: #define TWOWORDINLINE(w1,w2)
1471: #define THREEWORDINLINE(w1,w2,w3)
1472: #define FOURWORDINLINE(w1,w2,w3,w4)
1473: #define FIVEWORDINLINE(w1,w2,w3,w4,w5)
1474: #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6)
1475: #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7)
1476: #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8)
1477: #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9)
1478: #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10)
1479: #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11)
1480: #define TWELVEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12)
1481: #endif
1482:
1483:
1484: /****************************************************************************************************
1485:
1486: TARGET_CARBON - default: false. Switches all of the above as described. Overrides all others
1487: - NOTE: If you set TARGET_CARBON to 1, then the other switches will be setup by
1488: ConditionalMacros, and should not be set manually.
1489:
1490: If you wish to do development for pre-Carbon Systems, you can set the following:
1491:
1492: OPAQUE_TOOLBOX_STRUCTS - default: false. True for TARGET_CARBON, hides struct fields.
1493: ACCESSOR_CALLS_ARE_FUNCTIONS - default: false. True for TARGET_CARBON, preserve old #define-style accessors
1494: MIXEDMODE_CALLS_ARE_FUNCTIONS - default: false. True for TARGET_CARBON, turn MixedMode macros into functions
1495: CALL_NOT_IN_CARBON - default: true. False for TARGET_CARBON, hide calls not supported in Carbon
1496:
1497: ****************************************************************************************************/
1498: #ifndef TARGET_CARBON
1499: #define TARGET_CARBON 0
1500: #endif /* !defined(TARGET_CARBON) */
1501:
1502: #if TARGET_CARBON
1503: #define OPAQUE_TOOLBOX_STRUCTS 1
1504: #define ACCESSOR_CALLS_ARE_FUNCTIONS 1
1505: #define MIXEDMODE_CALLS_ARE_FUNCTIONS 1
1506: #define CALL_NOT_IN_CARBON 0
1507: #else
1508: #ifndef OPAQUE_TOOLBOX_STRUCTS
1509: #define OPAQUE_TOOLBOX_STRUCTS 0
1510: #endif /* !defined(OPAQUE_TOOLBOX_STRUCTS) */
1511:
1512: #ifndef ACCESSOR_CALLS_ARE_FUNCTIONS
1513: #define ACCESSOR_CALLS_ARE_FUNCTIONS 0
1514: #endif /* !defined(ACCESSOR_CALLS_ARE_FUNCTIONS) */
1515:
1516: /*
1517: * It's possible to have ACCESSOR_CALLS_ARE_FUNCTIONS set to true and OPAQUE_TOOLBOX_STRUCTS
1518: * set to false, but not the other way around, so make sure the defines are not set this way.
1519: */
1520: #if OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
1521: #error OPAQUE_TOOLBOX_STRUCTS cannot be true when ACCESSOR_CALLS_ARE_FUNCTIONS is false
1522: #endif /* OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS */
1523:
1524: #ifndef MIXEDMODE_CALLS_ARE_FUNCTIONS
1525: #define MIXEDMODE_CALLS_ARE_FUNCTIONS 0
1526: #endif /* !defined(MIXEDMODE_CALLS_ARE_FUNCTIONS) */
1527:
1528: #ifndef CALL_NOT_IN_CARBON
1529: #define CALL_NOT_IN_CARBON 1
1530: #endif /* !defined(CALL_NOT_IN_CARBON) */
1531:
1532: #endif /* TARGET_CARBON */
1533:
1534: /*
1535: Conditional forCarbon is a temporary workaround
1536: for the fact that our Carbon sources don't compile with
1537: TARGET_OS_MAC set yet. They compile TARGET_OS_UNIX now.
1538: */
1539: #ifndef forCarbon
1540: #define forCarbon 0
1541: #endif /* !defined(forCarbon) */
1542:
1543:
1544:
1545: #endif /* __CONDITIONALMACROS__ */
1546:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.