home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / ConditionalMacros.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  38.8 KB  |  1,271 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        ConditionalMacros.h
  3.  
  4.      Contains:    Set up for compiler independent conditionals
  5.  
  6.      Version:    Technology:    Universal Interface Files 3.0.1
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1993-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __CONDITIONALMACROS__
  19. #define __CONDITIONALMACROS__
  20.  
  21. /****************************************************************************************************
  22.     UNIVERSAL_INTERFACES_VERSION
  23.     
  24.         0x0301 => version 3.0.1
  25.         0x0300 => version 3.0
  26.         0x0210 => version 2.1
  27.         This conditional did not exist prior to version 2.1
  28. ****************************************************************************************************/
  29. #define UNIVERSAL_INTERFACES_VERSION 0x0301
  30.  
  31. /****************************************************************************************************
  32.  
  33.     TARGET_CPU_≈    
  34.     These conditionals specify which microprocessor instruction set is being
  35.     generated.  At most one of these is true, the rest are false.
  36.  
  37.         TARGET_CPU_PPC            - Compiler is generating PowerPC instructions
  38.         TARGET_CPU_68K            - Compiler is generating 680x0 instructions
  39.         TARGET_CPU_X86            - Compiler is generating x86 instructions
  40.         TARGET_CPU_MIPS            - Compiler is generating MIPS instructions
  41.         TARGET_CPU_SPARC        - Compiler is generating Sparc instructions
  42.         TARGET_CPU_ALPHA        - Compiler is generating Dec Alpha instructions
  43.  
  44.  
  45.     TARGET_OS_≈    
  46.     These conditionals specify in which Operating System the generated code will
  47.     run. At most one of the these is true, the rest are false.
  48.  
  49.         TARGET_OS_MAC            - Generate code will run under Mac OS
  50.         TARGET_OS_WIN32            - Generate code will run under 32-bit Windows
  51.         TARGET_OS_UNIX            - Generate code will run under some unix 
  52.  
  53.  
  54.     TARGET_RT_≈    
  55.     These conditionals specify in which runtime the generated code will
  56.     run. This is needed when the OS and CPU support more than one runtime
  57.     (e.g. MacOS on 68K supports CFM68K and Classic 68k).
  58.  
  59.         TARGET_RT_LITTLE_ENDIAN    - Generated code uses little endian format for integers
  60.         TARGET_RT_BIG_ENDIAN    - Generated code uses big endian format for integers     
  61.         TARGET_RT_MAC_CFM        - TARGET_OS_MAC is true and CFM68K or PowerPC CFM being used    
  62.         TARGET_RT_MAC_68881        - TARGET_OS_MAC is true and 68881 floating point instructions used    
  63.  
  64.  
  65.     PRAGMA_≈
  66.     These conditionals specify whether the compiler supports particular #pragma's
  67.     
  68.         PRAGMA_IMPORT             - Compiler supports: #pragma import on/off/reset
  69.         PRAGMA_ONCE              - Compiler supports: #pragma once
  70.         PRAGMA_STRUCT_ALIGN      - Compiler supports: #pragma options align=mac68k/power/reset
  71.         PRAGMA_STRUCT_PACK        - Compiler supports: #pragma pack(n)
  72.         PRAGMA_STRUCT_PACKPUSH    - Compiler supports: #pragma pack(push, n)/pack(pop)
  73.         PRAGMA_ENUM_PACK         - Compiler supports: #pragma options(!pack_enums)
  74.         PRAGMA_ENUM_ALWAYSINT     - Compiler supports: #pragma enumsalwaysint on/off/reset
  75.         PRAGMA_ENUM_OPTIONS        - Compiler supports: #pragma options enum=int/small/reset
  76.  
  77.     FOUR_CHAR_CODE
  78.     This conditional does the proper byte swapping to assue that a four character code (e.g. 'TEXT')
  79.     is compiled down to the correct value on all compilers.
  80.  
  81.         FOUR_CHAR_CODE('abcd')    - Convert a four-char-code to the correct 32-bit value
  82.  
  83.     TYPE_≈
  84.     These conditionals specify whether the compiler supports particular types.
  85.  
  86.         TYPE_LONGLONG            - Compiler supports "long long" 64-bit integers
  87.         TYPE_BOOL                - Compiler supports "bool"
  88.         TYPE_EXTENDED            - Compiler supports "extended" 80/96 bit floating point
  89.  
  90. ****************************************************************************************************/
  91.  
  92. #if defined(__MRC__)
  93.     /*
  94.         MrC[pp] compiler from Apple Computer, Inc.
  95.     */
  96.     #define TARGET_CPU_PPC              1
  97.     #define TARGET_CPU_68K              0
  98.     #define TARGET_CPU_X86              0
  99.     #define TARGET_CPU_MIPS             0
  100.     #define TARGET_CPU_SPARC            0        
  101.     #define TARGET_CPU_ALPHA            0
  102.     #define TARGET_OS_MAC                1
  103.     #define TARGET_OS_WIN32                0
  104.     #define TARGET_OS_UNIX                0
  105.     #define TARGET_RT_LITTLE_ENDIAN        0
  106.     #define TARGET_RT_BIG_ENDIAN        1
  107.     #define TARGET_RT_MAC_CFM            1
  108.     #define TARGET_RT_MAC_68881            0
  109.     #if (__MRC__  > 0x0200) && (__MRC__ < 0x0700)
  110.         #define PRAGMA_IMPORT            1
  111.     #else
  112.         #define PRAGMA_IMPORT            0
  113.     #endif
  114.     #define PRAGMA_STRUCT_ALIGN            1
  115.     #define PRAGMA_ONCE                    1
  116.     #define PRAGMA_STRUCT_PACK            0
  117.     #define PRAGMA_STRUCT_PACKPUSH        0
  118.     #define PRAGMA_ENUM_PACK            1
  119.     #define PRAGMA_ENUM_ALWAYSINT        0
  120.     #define PRAGMA_ENUM_OPTIONS            0
  121.     #define FOUR_CHAR_CODE(x)            (x)
  122.         
  123.     #if (__MRC__  > 0x0300) && (__MRC__ < 0x0700)
  124.         #if __option(longlong)
  125.             #define TYPE_LONGLONG        1
  126.         #else
  127.             #define TYPE_LONGLONG        0
  128.         #endif
  129.         #if __option(bool)
  130.             #define TYPE_BOOL            1
  131.         #else
  132.             #define TYPE_BOOL            0
  133.         #endif
  134.     #else
  135.         #define TYPE_LONGLONG            0
  136.         #define TYPE_BOOL                0
  137.     #endif
  138.     #define TYPE_EXTENDED                0
  139.     
  140.  
  141.  
  142. #elif defined(__SC__) && (defined(MPW_CPLUS) || defined(MPW_C))
  143.     /*
  144.         SC[pp] compiler from Apple Computer, Inc.
  145.     */
  146.     #define TARGET_CPU_PPC              0
  147.     #define TARGET_CPU_68K              1
  148.     #define TARGET_CPU_X86              0
  149.     #define TARGET_CPU_MIPS             0
  150.     #define TARGET_CPU_SPARC            0        
  151.     #define TARGET_CPU_ALPHA            0
  152.     #define TARGET_OS_MAC                1
  153.     #define TARGET_OS_WIN32                0
  154.     #define TARGET_OS_UNIX                0
  155.     #define TARGET_RT_LITTLE_ENDIAN        0
  156.     #define TARGET_RT_BIG_ENDIAN        1
  157.     #if defined(__CFM68K__)
  158.         #define TARGET_RT_MAC_CFM        1
  159.     #else
  160.         #define TARGET_RT_MAC_CFM        0
  161.     #endif
  162.     #if defined(mc68881)
  163.         #define TARGET_RT_MAC_68881        1
  164.     #else
  165.         #define TARGET_RT_MAC_68881        0
  166.     #endif
  167.     #if TARGET_RT_MAC_CFM 
  168.         #define PRAGMA_IMPORT            1
  169.         #if (__SC__ <= 0x0810)
  170.             /* old versions of SC don't support “#pragma import reset” */
  171.             #define PRAGMA_IMPORT_OFF    1
  172.         #endif
  173.     #else
  174.         #define PRAGMA_IMPORT            0
  175.     #endif
  176.     #define PRAGMA_STRUCT_ALIGN            0
  177.     #define PRAGMA_ONCE                    0
  178.     #define PRAGMA_STRUCT_PACK            0
  179.     #define PRAGMA_STRUCT_PACKPUSH        0
  180.     #define PRAGMA_ENUM_PACK            1
  181.     #define PRAGMA_ENUM_ALWAYSINT        0
  182.     #define PRAGMA_ENUM_OPTIONS            0
  183.     #define FOUR_CHAR_CODE(x)            (x)
  184.     
  185.     #define TYPE_LONGLONG                0
  186.     #define TYPE_EXTENDED                1
  187.     #if (__SC__  > 0x0810)
  188.         #if __option(bool)
  189.             #define TYPE_BOOL            1
  190.         #else
  191.             #define TYPE_BOOL            0
  192.         #endif
  193.     #else
  194.         #define TYPE_BOOL                0
  195.     #endif
  196.         
  197.  
  198.  
  199. #elif defined(__MWERKS__)
  200.     /*
  201.         CodeWarrior compiler from Metrowerks, Inc.
  202.     */
  203.     #if (__MWERKS__ < 0x0900) || macintosh
  204.         #define TARGET_OS_MAC                1
  205.         #define TARGET_OS_WIN32                0
  206.         #define TARGET_OS_UNIX                0
  207.         #define TARGET_CPU_X86              0
  208.         #define TARGET_CPU_MIPS             0
  209.         #define TARGET_CPU_SPARC            0        
  210.         #define TARGET_CPU_ALPHA            0
  211.         #define TARGET_RT_LITTLE_ENDIAN        0
  212.         #define TARGET_RT_BIG_ENDIAN        1
  213.         #if powerc
  214.             #define TARGET_CPU_PPC          1
  215.             #define TARGET_CPU_68K          0
  216.             #define TARGET_RT_MAC_CFM        1
  217.             #define TARGET_RT_MAC_68881        0
  218.         #else
  219.             #define TARGET_CPU_PPC          0
  220.             #define TARGET_CPU_68K          1
  221.             #if defined(__CFM68K__)
  222.                 #define TARGET_RT_MAC_CFM    1
  223.             #else
  224.                 #define TARGET_RT_MAC_CFM    0
  225.             #endif
  226.             #if __MC68881__
  227.                 #define TARGET_RT_MAC_68881    1
  228.             #else
  229.                 #define TARGET_RT_MAC_68881    0
  230.             #endif
  231.         #endif
  232.     #elif (__MWERKS__ >= 0x0900) && __INTEL__
  233.         #define TARGET_CPU_PPC              0
  234.         #define TARGET_CPU_68K              0
  235.         #define TARGET_CPU_X86              1
  236.         #define TARGET_CPU_MIPS             0
  237.         #define TARGET_CPU_SPARC            0        
  238.         #define TARGET_CPU_ALPHA            0
  239.         #define TARGET_OS_MAC                0
  240.         #define TARGET_OS_WIN32                1
  241.         #define TARGET_OS_UNIX                0
  242.         #define TARGET_RT_LITTLE_ENDIAN        1
  243.         #define TARGET_RT_BIG_ENDIAN        0
  244.         #define TARGET_RT_MAC_CFM            0
  245.         #define TARGET_RT_MAC_68881            0
  246.     #else    
  247.         #error unknown Metrowerks compiler
  248.     #endif
  249.  
  250.  
  251.     #if (__MWERKS__ >= 0x0700)
  252.         #define PRAGMA_IMPORT                TARGET_RT_MAC_CFM
  253.     #else
  254.         #define PRAGMA_IMPORT                0
  255.     #endif
  256.     #define PRAGMA_STRUCT_ALIGN                1
  257.     #define PRAGMA_ONCE                        1
  258.     #define PRAGMA_STRUCT_PACK                1
  259.     #define PRAGMA_STRUCT_PACKPUSH            1
  260.     #define PRAGMA_ENUM_PACK                0
  261.     #define PRAGMA_ENUM_ALWAYSINT            1
  262.     #define PRAGMA_ENUM_OPTIONS                0
  263.     #define FOUR_CHAR_CODE(x)                (x)
  264.     
  265.     #if (__MWERKS__ >= 0x1100)
  266.         #if __option(longlong)
  267.             #define TYPE_LONGLONG        1
  268.             #define _LONG_LONG            1        /* temporary */
  269.         #else
  270.             #define TYPE_LONGLONG        0
  271.         #endif
  272.     #else
  273.         #define TYPE_LONGLONG            0
  274.     #endif
  275.     #if (__MWERKS__ >= 0x1000)
  276.         #if __option(bool)
  277.             #define TYPE_BOOL            1
  278.         #else
  279.             #define TYPE_BOOL            0
  280.         #endif
  281.     #else
  282.         #define TYPE_BOOL                0
  283.     #endif
  284.  
  285.     #if TARGET_OS_MAC && TARGET_CPU_68K
  286.         typedef long double extended;
  287.         #define TYPE_EXTENDED            1
  288.     #else
  289.         #define TYPE_EXTENDED            0
  290.     #endif
  291.  
  292.  
  293.  
  294. #elif defined(SYMANTEC_CPLUS) || defined(SYMANTEC_C)
  295.     /*
  296.         C and C++ compiler from Symantec, Inc.
  297.     */
  298.     #define TARGET_OS_MAC                1
  299.     #define TARGET_OS_WIN32                0
  300.     #define TARGET_OS_UNIX                0
  301.     #define TARGET_CPU_X86              0
  302.     #define TARGET_CPU_MIPS             0
  303.     #define TARGET_CPU_SPARC            0        
  304.     #define TARGET_CPU_ALPHA            0
  305.     #define TARGET_RT_LITTLE_ENDIAN        0
  306.     #define TARGET_RT_BIG_ENDIAN        1
  307.     #if powerc
  308.         #define TARGET_CPU_PPC          1
  309.         #define TARGET_CPU_68K          0
  310.         #define TARGET_RT_MAC_CFM        1
  311.         #define TARGET_RT_MAC_68881        0
  312.     #else
  313.         #define TARGET_CPU_PPC          0
  314.         #define TARGET_CPU_68K          1
  315.         #if defined(__CFM68K)
  316.             #define TARGET_RT_MAC_CFM    1
  317.         #else
  318.             #define TARGET_RT_MAC_CFM    0
  319.         #endif
  320.         #if mc68881
  321.             #define TARGET_RT_MAC_68881    1
  322.         #else
  323.             #define TARGET_RT_MAC_68881    0
  324.         #endif
  325.     #endif
  326.     #define PRAGMA_IMPORT                0
  327.     #define PRAGMA_ONCE                    1
  328.     #define PRAGMA_STRUCT_ALIGN            1
  329.     #define PRAGMA_STRUCT_PACK            0
  330.     #define PRAGMA_STRUCT_PACKPUSH        0
  331.     #define PRAGMA_ENUM_PACK            1
  332.     #define PRAGMA_ENUM_ALWAYSINT        0
  333.     #define PRAGMA_ENUM_OPTIONS            0
  334.     #define FOUR_CHAR_CODE(x)            (x)
  335.     
  336.     #if __useAppleExts__
  337.         #define TYPE_EXTENDED            1
  338.     #else
  339.         #define TYPE_EXTENDED            0
  340.     #endif
  341.     #define TYPE_LONGLONG                0
  342.     #define TYPE_BOOL                    0
  343.     
  344.  
  345.  
  346. #elif defined(THINK_C)
  347.     /*
  348.         THINK C compiler from Symantec, Inc.        << WARNING: Unsupported Compiler >>
  349.     */
  350.     #define TARGET_CPU_PPC              0
  351.     #define TARGET_CPU_68K              1
  352.     #define TARGET_CPU_X86              0
  353.     #define TARGET_CPU_MIPS             0
  354.     #define TARGET_CPU_SPARC            0        
  355.     #define TARGET_CPU_ALPHA            0
  356.     #define TARGET_OS_MAC                1
  357.     #define TARGET_OS_WIN32                0
  358.     #define TARGET_OS_UNIX                0
  359.     #define TARGET_RT_LITTLE_ENDIAN        0
  360.     #define TARGET_RT_BIG_ENDIAN        1
  361.     #define TARGET_RT_MAC_CFM            0
  362.     #if defined(mc68881)
  363.         #define TARGET_RT_MAC_68881        1
  364.     #else
  365.         #define TARGET_RT_MAC_68881        0
  366.     #endif
  367.     #define PRAGMA_IMPORT                0
  368.     #define PRAGMA_STRUCT_ALIGN            0
  369.     #define PRAGMA_ONCE                    1
  370.     #define PRAGMA_STRUCT_PACK            0
  371.     #define PRAGMA_STRUCT_PACKPUSH        0
  372.     #define PRAGMA_ENUM_PACK            1
  373.     #define PRAGMA_ENUM_ALWAYSINT        0
  374.     #define PRAGMA_ENUM_OPTIONS            0
  375.     #define FOUR_CHAR_CODE(x)            (x)
  376.     
  377.     #define TYPE_EXTENDED                1
  378.     #define TYPE_LONGLONG                0
  379.     #define TYPE_BOOL                    0
  380.     
  381.  
  382.  
  383. #elif defined(__PPCC__)
  384.     /*
  385.         PPCC compiler from Apple Computer, Inc.        << WARNING: Unsupported Compiler >>
  386.     */
  387.     #define TARGET_CPU_PPC              1
  388.     #define TARGET_CPU_68K              0
  389.     #define TARGET_CPU_X86              0
  390.     #define TARGET_CPU_MIPS             0
  391.     #define TARGET_CPU_SPARC            0        
  392.     #define TARGET_CPU_ALPHA            0
  393.     #define TARGET_OS_MAC                1
  394.     #define TARGET_OS_WIN32                0
  395.     #define TARGET_OS_UNIX                0
  396.     #define TARGET_RT_LITTLE_ENDIAN        0
  397.     #define TARGET_RT_BIG_ENDIAN        1
  398.     #define TARGET_RT_MAC_CFM            1
  399.     #define TARGET_RT_MAC_68881            0
  400.     #define PRAGMA_IMPORT                0
  401.     #define PRAGMA_STRUCT_ALIGN            1
  402.     #define PRAGMA_ONCE                    0
  403.     #define PRAGMA_STRUCT_PACK            0
  404.     #define PRAGMA_STRUCT_PACKPUSH        0
  405.     #define PRAGMA_ENUM_PACK            0
  406.     #define PRAGMA_ENUM_ALWAYSINT        0
  407.     #define PRAGMA_ENUM_OPTIONS            0
  408.     #define FOUR_CHAR_CODE(x)            (x)
  409.     
  410.     #define TYPE_EXTENDED                0
  411.     #define TYPE_LONGLONG                0
  412.     #define TYPE_BOOL                    0
  413.  
  414.  
  415. #elif defined(applec) && !defined(__SC__)
  416.     /*
  417.         MPW C compiler from Apple Computer, Inc.    << WARNING: Unsupported Compiler >>
  418.     */
  419.     #define TARGET_CPU_PPC              0
  420.     #define TARGET_CPU_68K              1
  421.     #define TARGET_CPU_X86              0
  422.     #define TARGET_CPU_MIPS             0
  423.     #define TARGET_CPU_SPARC            0        
  424.     #define TARGET_CPU_ALPHA            0
  425.     #define TARGET_OS_MAC                1
  426.     #define TARGET_OS_WIN32                0
  427.     #define TARGET_OS_UNIX                0
  428.     #define TARGET_RT_LITTLE_ENDIAN        0
  429.     #define TARGET_RT_BIG_ENDIAN        1
  430.     #define TARGET_RT_MAC_CFM            0
  431.     #if defined(mc68881)
  432.         #define TARGET_RT_MAC_68881        1
  433.     #else
  434.         #define TARGET_RT_MAC_68881        0
  435.     #endif
  436.     #define PRAGMA_IMPORT                0
  437.     #define PRAGMA_STRUCT_ALIGN            0
  438.     #define PRAGMA_ONCE                    0
  439.     #define PRAGMA_STRUCT_PACK            0
  440.     #define PRAGMA_STRUCT_PACKPUSH        0
  441.     #define PRAGMA_ENUM_PACK            0
  442.     #define PRAGMA_ENUM_ALWAYSINT        0
  443.     #define PRAGMA_ENUM_OPTIONS            0
  444.     /* Note: MPW C 3.2 had a bug where MACRO('xx   ') would cause 'xx  ' to be misevaluated */
  445.     #define FOUR_CHAR_CODE                
  446.  
  447.     #define TYPE_EXTENDED                1
  448.     #define TYPE_LONGLONG                0
  449.     #define TYPE_BOOL                    0
  450.  
  451.  
  452.  
  453. #elif defined(__GNUC__) && defined(__NEXT_CPP__)
  454.     /*
  455.         gcc from Next, Inc., with cpp-precomp (header precompiler)
  456.     */
  457.     #if defined(powerpc) || defined(ppc)
  458.         #define TARGET_CPU_PPC            1
  459.         #define TARGET_CPU_68K            0
  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_RT_MAC_CFM        1
  465.         #define TARGET_RT_MAC_68881        0
  466.         #define TARGET_RT_LITTLE_ENDIAN    0
  467.         #define TARGET_RT_BIG_ENDIAN    1
  468.     #elif defined(m68k)
  469.         #define TARGET_CPU_PPC            0
  470.         #define TARGET_CPU_68K            1
  471.         #define TARGET_CPU_X86            0
  472.         #define TARGET_CPU_MIPS            0
  473.         #define TARGET_CPU_SPARC        0   
  474.         #define TARGET_CPU_ALPHA        0
  475.         #define TARGET_RT_MAC_CFM        0
  476.         #define TARGET_RT_MAC_68881        0
  477.         #define TARGET_RT_LITTLE_ENDIAN 0
  478.         #define TARGET_RT_BIG_ENDIAN    1
  479.     #elif defined(sparc)
  480.         #define TARGET_CPU_PPC            0
  481.         #define TARGET_CPU_68K            0
  482.         #define TARGET_CPU_X86            0
  483.         #define TARGET_CPU_MIPS            0
  484.         #define TARGET_CPU_SPARC        1
  485.         #define TARGET_CPU_ALPHA        0
  486.         #define TARGET_RT_MAC_CFM        0
  487.         #define TARGET_RT_MAC_68881        0
  488.         #define TARGET_RT_LITTLE_ENDIAN    0
  489.         #define TARGET_RT_BIG_ENDIAN    1
  490.     #elif defined(i386) || defined(intel)
  491.         #define TARGET_CPU_PPC            0
  492.         #define TARGET_CPU_68K            0
  493.         #define TARGET_CPU_X86            1
  494.         #define TARGET_CPU_MIPS            0
  495.         #define TARGET_CPU_SPARC        0
  496.         #define TARGET_CPU_ALPHA        0
  497.         #define TARGET_RT_MAC_CFM        0
  498.         #define TARGET_RT_MAC_68881        0
  499.         #define TARGET_RT_LITTLE_ENDIAN    1
  500.         #define TARGET_RT_BIG_ENDIAN    0
  501.     #else
  502.         #error unrecognized NeXT GNU C compiler
  503.     #endif
  504.  
  505.  
  506.     #define TARGET_OS_MAC                0
  507.     #define TARGET_OS_WIN32                0
  508.     #define TARGET_OS_UNIX                1
  509.     #define PRAGMA_IMPORT                0
  510.     #define PRAGMA_STRUCT_ALIGN            1
  511.     #define PRAGMA_ONCE                    0
  512.     #define PRAGMA_STRUCT_PACK            0
  513.     #define PRAGMA_STRUCT_PACKPUSH        0
  514.     #define PRAGMA_ENUM_PACK            0
  515.     #define PRAGMA_ENUM_ALWAYSINT        0
  516.     #define PRAGMA_ENUM_OPTIONS            0
  517.     #define FOUR_CHAR_CODE(x)            (x)
  518.  
  519.     #define TYPE_EXTENDED                0
  520.     #ifdef _LONG_LONG
  521.         #define TYPE_LONGLONG            1
  522.     #else
  523.         #define TYPE_LONGLONG            0
  524.     #endif
  525.     #define TYPE_BOOL                    0
  526.  
  527.  
  528. #elif defined(__GNUC__)
  529.     /*
  530.         gC for MPW from Free Software Foundation, Inc.
  531.     */
  532.     #if #cpu(powerpc)
  533.         #define TARGET_CPU_PPC          1
  534.         #define TARGET_CPU_68K          0
  535.         #define TARGET_CPU_X86          0
  536.         #define TARGET_CPU_MIPS         0
  537.         #define TARGET_CPU_SPARC        0    
  538.         #define TARGET_CPU_ALPHA        0
  539.         #define TARGET_RT_MAC_CFM        1
  540.         #define TARGET_RT_MAC_68881        0
  541.     #elif #cpu(m68k)
  542.         #define TARGET_CPU_PPC          0
  543.         #define TARGET_CPU_68K          1
  544.         #define TARGET_CPU_X86          0
  545.         #define TARGET_CPU_MIPS         0
  546.         #define TARGET_CPU_SPARC        0    
  547.         #define TARGET_CPU_ALPHA        0
  548.         #define TARGET_RT_MAC_CFM        0
  549.         #define TARGET_RT_MAC_68881        0
  550.     #else
  551.         #error unsupported GNU C compiler
  552.     #endif
  553.     
  554.     #if #system(macos)
  555.         #define TARGET_OS_MAC            1
  556.         #define TARGET_OS_WIN32            0
  557.         #define TARGET_OS_UNIX            0
  558.     #elif #system(unix)
  559.         #define TARGET_OS_MAC            0
  560.         #define TARGET_OS_WIN32            0
  561.         #define TARGET_OS_UNIX            1
  562.     #else
  563.         #error unsupported GNU C compiler
  564.     #endif
  565.     
  566.     #define TARGET_RT_LITTLE_ENDIAN        0
  567.     #define TARGET_RT_BIG_ENDIAN        1
  568.     #define PRAGMA_IMPORT                0
  569.     #define PRAGMA_STRUCT_ALIGN            1
  570.     #define PRAGMA_ONCE                    0
  571.     #define PRAGMA_STRUCT_PACK            0
  572.     #define PRAGMA_STRUCT_PACKPUSH        0
  573.     #define PRAGMA_ENUM_PACK            0
  574.     #define PRAGMA_ENUM_ALWAYSINT        0
  575.     #define PRAGMA_ENUM_OPTIONS            0
  576.     #define FOUR_CHAR_CODE(x)            (x)
  577.  
  578.     #define TYPE_EXTENDED                0
  579.     #ifdef _LONG_LONG
  580.         #define TYPE_LONGLONG            1
  581.     #else
  582.         #define TYPE_LONGLONG            0
  583.     #endif
  584.     #define TYPE_BOOL                    0
  585.  
  586.  
  587.  
  588. #elif defined(__xlc) || defined(__xlC) || defined(__xlC__) || defined(__XLC121__)
  589.     /*
  590.         xlc and xlC on RS/6000 from IBM, Inc.
  591.     */
  592.     #define TARGET_CPU_PPC              1
  593.     #define TARGET_CPU_68K              0
  594.     #define TARGET_CPU_X86              0
  595.     #define TARGET_CPU_MIPS             0
  596.     #define TARGET_CPU_SPARC            0        
  597.     #define TARGET_CPU_ALPHA            0
  598.     #if defined(_AIX)
  599.         #define TARGET_OS_MAC            0
  600.         #define TARGET_OS_UNIX            1
  601.     #else
  602.         #define TARGET_OS_MAC            1
  603.         #define TARGET_OS_UNIX            0
  604.     #endif
  605.     #define TARGET_OS_WIN32                0
  606.     #define TARGET_RT_LITTLE_ENDIAN        0
  607.     #define TARGET_RT_BIG_ENDIAN        1
  608.     #define TARGET_RT_MAC_CFM            1
  609.     #define TARGET_RT_MAC_68881            0
  610.     #define PRAGMA_IMPORT                0
  611.     #define PRAGMA_STRUCT_ALIGN            1
  612.     #define PRAGMA_ONCE                    0
  613.     #define PRAGMA_STRUCT_PACK            0
  614.     #define PRAGMA_STRUCT_PACKPUSH        0
  615.     #define PRAGMA_ENUM_PACK            0
  616.     #define PRAGMA_ENUM_ALWAYSINT        0
  617.     #define PRAGMA_ENUM_OPTIONS            1
  618.     #define FOUR_CHAR_CODE(x)            (x)
  619.  
  620.     #define TYPE_EXTENDED                0
  621.     #ifdef _LONG_LONG
  622.         #define TYPE_LONGLONG            1
  623.     #else
  624.         #define TYPE_LONGLONG            0
  625.     #endif
  626.     #define TYPE_BOOL                    0
  627.  
  628.  
  629. #elif defined(_MSC_VER) && !defined(__MWERKS__) 
  630.     /*
  631.         Visual C++ from Microsoft, Inc.
  632.     */
  633.     #if defined(_M_M68K)    /* Visual C++ with Macintosh 68K target */
  634.         #define TARGET_CPU_PPC              0
  635.         #define TARGET_CPU_68K              1
  636.         #define TARGET_CPU_X86              0
  637.         #define TARGET_CPU_MIPS             0
  638.         #define TARGET_CPU_SPARC            0
  639.         #define TARGET_CPU_ALPHA            0
  640.         #define TARGET_OS_MAC                1
  641.         #define TARGET_OS_WIN32                0
  642.         #define TARGET_OS_UNIX                0
  643.         #define TARGET_RT_LITTLE_ENDIAN        0
  644.         #define TARGET_RT_BIG_ENDIAN        1
  645.         #define TARGET_RT_MAC_CFM            0
  646.         #define TARGET_RT_MAC_68881            0
  647.         #define PRAGMA_IMPORT                0
  648.         #define PRAGMA_STRUCT_ALIGN            1
  649.         #define PRAGMA_ONCE                     0
  650.         #define PRAGMA_STRUCT_PACK            1
  651.         #define PRAGMA_STRUCT_PACKPUSH        1
  652.         #define PRAGMA_ENUM_PACK            0
  653.         #define PRAGMA_ENUM_ALWAYSINT        0
  654.         #define PRAGMA_ENUM_OPTIONS            0
  655.         #define FOUR_CHAR_CODE(x)            (x)
  656.         #define TYPE_EXTENDED                0
  657.         #define TYPE_LONGLONG                0
  658.         #define TYPE_BOOL                    0
  659.     #elif defined(_M_MPPC)    /* Visual C++ with Macintosh PowerPC target */
  660.         #define TARGET_CPU_PPC              1
  661.         #define TARGET_CPU_68K              0
  662.         #define TARGET_CPU_X86              0
  663.         #define TARGET_CPU_MIPS             0
  664.         #define TARGET_CPU_SPARC            0
  665.         #define TARGET_CPU_ALPHA            0
  666.         #define TARGET_OS_MAC                1
  667.         #define TARGET_OS_WIN32                0
  668.         #define TARGET_OS_UNIX                0
  669.         #define TARGET_RT_LITTLE_ENDIAN        0
  670.         #define TARGET_RT_BIG_ENDIAN        1
  671.         #define TARGET_RT_MAC_CFM            1
  672.         #define TARGET_RT_MAC_68881            0
  673.         #define PRAGMA_IMPORT                0
  674.         #define PRAGMA_STRUCT_ALIGN            1
  675.         #define PRAGMA_ONCE                     0
  676.         #define PRAGMA_STRUCT_PACK            1
  677.         #define PRAGMA_STRUCT_PACKPUSH        1
  678.         #define PRAGMA_ENUM_PACK            0
  679.         #define PRAGMA_ENUM_ALWAYSINT        0
  680.         #define PRAGMA_ENUM_OPTIONS            0
  681.         #define FOUR_CHAR_CODE(x)            (x)
  682.         #define TYPE_EXTENDED                0
  683.         #define TYPE_LONGLONG                0
  684.         #define TYPE_BOOL                    0
  685.  
  686.     #elif defined(_M_IX86)    /* Visual C++ with Intel x86 target */
  687.         #define TARGET_CPU_PPC              0
  688.         #define TARGET_CPU_68K              0
  689.         #define TARGET_CPU_X86              1
  690.         #define TARGET_CPU_MIPS             0
  691.         #define TARGET_CPU_SPARC            0
  692.         #define TARGET_CPU_ALPHA            0
  693.         #define TARGET_OS_MAC                0
  694.         #define TARGET_OS_WIN32                1
  695.         #define TARGET_OS_UNIX                0
  696.         #define TARGET_RT_LITTLE_ENDIAN        1
  697.         #define TARGET_RT_BIG_ENDIAN        0
  698.         #define TARGET_RT_MAC_CFM            0
  699.         #define TARGET_RT_MAC_68881            0
  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        1
  705.         #define PRAGMA_ENUM_PACK            0
  706.         #define PRAGMA_ENUM_ALWAYSINT        0
  707.         #define PRAGMA_ENUM_OPTIONS            0
  708.         #define FOUR_CHAR_CODE(x)        (((DWORD) ((x) & 0x000000FF)) << 24) \
  709.                                     | (((DWORD) ((x) & 0x0000FF00)) << 8) \
  710.                                     | (((DWORD) ((x) & 0x00FF0000)) >> 8) \
  711.                                     | (((DWORD) ((x) & 0xFF000000)) >> 24)
  712.         #define TYPE_EXTENDED                0
  713.         #define TYPE_LONGLONG                0
  714.         #if defined(__cplusplus) && (_MSC_VER >= 1100)
  715.             #define TYPE_BOOL                1
  716.         #else
  717.             #define TYPE_BOOL                0
  718.         #endif
  719.  
  720.         #elif defined(_M_ALPHA)        /* Visual C++ with Dec Alpha target */
  721.         #define TARGET_CPU_PPC              0
  722.         #define TARGET_CPU_68K              0
  723.         #define TARGET_CPU_X86              0
  724.         #define TARGET_CPU_MIPS             0
  725.         #define TARGET_CPU_SPARC            0
  726.         #define TARGET_CPU_ALPHA            1
  727.         #define TARGET_OS_MAC                0
  728.         #define TARGET_OS_WIN32                1
  729.         #define TARGET_OS_UNIX                0
  730.         #define TARGET_RT_LITTLE_ENDIAN        1
  731.         #define TARGET_RT_BIG_ENDIAN        0
  732.         #define TARGET_RT_MAC_CFM            0
  733.         #define TARGET_RT_MAC_68881            0
  734.         #define PRAGMA_IMPORT                0
  735.         #define PRAGMA_STRUCT_ALIGN            0
  736.         #define PRAGMA_ONCE                     0
  737.         #define PRAGMA_STRUCT_PACK            1
  738.         #define PRAGMA_STRUCT_PACKPUSH        1
  739.         #define PRAGMA_ENUM_PACK            0
  740.         #define PRAGMA_ENUM_ALWAYSINT        0
  741.         #define PRAGMA_ENUM_OPTIONS            0
  742.         #define FOUR_CHAR_CODE(x)        (((DWORD) ((x) & 0x000000FF)) << 24) \
  743.                                     | (((DWORD) ((x) & 0x0000FF00)) << 8) \
  744.                                     | (((DWORD) ((x) & 0x00FF0000)) >> 8) \
  745.                                     | (((DWORD) ((x) & 0xFF000000)) >> 24)
  746.         #define TYPE_EXTENDED                0
  747.         #define TYPE_LONGLONG                0
  748.         #define TYPE_BOOL                    0
  749.  
  750.     #elif defined(_M_PPC)    /* Visual C++ for Windows NT on PowerPC target */
  751.         #define TARGET_CPU_PPC              1
  752.         #define TARGET_CPU_68K              0
  753.         #define TARGET_CPU_X86              0
  754.         #define TARGET_CPU_MIPS             0
  755.         #define TARGET_CPU_SPARC            0
  756.         #define TARGET_CPU_ALPHA            0
  757.         #define TARGET_OS_MAC                0
  758.         #define TARGET_OS_WIN32                1
  759.         #define TARGET_OS_UNIX                0
  760.         #define TARGET_RT_LITTLE_ENDIAN        1
  761.         #define TARGET_RT_BIG_ENDIAN        0
  762.         #define TARGET_RT_MAC_CFM            0
  763.         #define TARGET_RT_MAC_68881            0
  764.         #define PRAGMA_IMPORT                0
  765.         #define PRAGMA_STRUCT_ALIGN            0
  766.         #define PRAGMA_ONCE                     0
  767.         #define PRAGMA_STRUCT_PACK            1
  768.         #define PRAGMA_STRUCT_PACKPUSH        1
  769.         #define PRAGMA_ENUM_PACK            0
  770.         #define PRAGMA_ENUM_ALWAYSINT        0
  771.         #define PRAGMA_ENUM_OPTIONS            0
  772.         #define FOUR_CHAR_CODE(x)        (((DWORD) ((x) & 0x000000FF)) << 24) \
  773.                                     | (((DWORD) ((x) & 0x0000FF00)) << 8) \
  774.                                     | (((DWORD) ((x) & 0x00FF0000)) >> 8) \
  775.                                     | (((DWORD) ((x) & 0xFF000000)) >> 24)
  776.         #define TYPE_EXTENDED                0
  777.         #define TYPE_LONGLONG                0
  778.         #define TYPE_BOOL                    0
  779.  
  780.         #elif defined(_M_MRX000)    /* Visual C++ for Windows NT on MIPS target */
  781.         #define TARGET_CPU_PPC              0
  782.         #define TARGET_CPU_68K              0
  783.         #define TARGET_CPU_X86              0
  784.         #define TARGET_CPU_MIPS             1
  785.         #define TARGET_CPU_SPARC            0
  786.         #define TARGET_CPU_ALPHA            0
  787.         #define TARGET_OS_MAC                0
  788.         #define TARGET_OS_WIN32                1
  789.         #define TARGET_OS_UNIX                0
  790.         #define TARGET_RT_LITTLE_ENDIAN        1
  791.         #define TARGET_RT_BIG_ENDIAN        0
  792.         #define TARGET_RT_MAC_CFM            0
  793.         #define TARGET_RT_MAC_68881            0
  794.         #define PRAGMA_IMPORT                0
  795.         #define PRAGMA_STRUCT_ALIGN            0
  796.         #define PRAGMA_ONCE                     0
  797.         #define PRAGMA_STRUCT_PACK            1
  798.         #define PRAGMA_STRUCT_PACKPUSH        1
  799.         #define PRAGMA_ENUM_PACK            0
  800.         #define PRAGMA_ENUM_ALWAYSINT        0
  801.         #define PRAGMA_ENUM_OPTIONS            0
  802.         #define FOUR_CHAR_CODE(x)        (((DWORD) ((x) & 0x000000FF)) << 24) \
  803.                                     | (((DWORD) ((x) & 0x0000FF00)) << 8) \
  804.                                     | (((DWORD) ((x) & 0x00FF0000)) >> 8) \
  805.                                     | (((DWORD) ((x) & 0xFF000000)) >> 24)
  806.         #define TYPE_EXTENDED                0
  807.         #define TYPE_LONGLONG                0
  808.         #define TYPE_BOOL                    0
  809.     #endif
  810.  
  811.  
  812. #elif defined(__MOTO__)
  813.     /*
  814.         mcc from Motorola, Inc.  (( This is just a guess and may contain errors )) 
  815.     */
  816.     #define TARGET_CPU_PPC              1
  817.     #define TARGET_CPU_68K              0
  818.     #define TARGET_CPU_X86              0
  819.     #define TARGET_CPU_MIPS             0
  820.     #define TARGET_CPU_SPARC            0        
  821.     #define TARGET_CPU_ALPHA            0
  822.     #define TARGET_OS_MAC                1
  823.     #define TARGET_OS_WIN32                0
  824.     #define TARGET_OS_UNIX                0
  825.     #define TARGET_RT_LITTLE_ENDIAN        0
  826.     #define TARGET_RT_BIG_ENDIAN        1
  827.     #define TARGET_RT_MAC_CFM            1
  828.     #define TARGET_RT_MAC_68881            0
  829.     #define PRAGMA_IMPORT                0            /* how is this detected ?? */
  830.     #define PRAGMA_STRUCT_ALIGN            1
  831.     #define PRAGMA_ONCE                    1
  832.     #define PRAGMA_STRUCT_PACK            0
  833.     #define PRAGMA_STRUCT_PACKPUSH        0
  834.     #define PRAGMA_ENUM_PACK            0
  835.     #define PRAGMA_ENUM_ALWAYSINT        0
  836.     #define PRAGMA_ENUM_OPTIONS            0
  837.     #define FOUR_CHAR_CODE(x)            (x)
  838.     #define TYPE_LONGLONG                0            /* how is this detected ?? */
  839.     #ifdef _BOOL
  840.         #define TYPE_BOOL                1            
  841.     #else
  842.         #define TYPE_BOOL                0            
  843.     #endif
  844.     #define TYPE_EXTENDED                0
  845.  
  846.  
  847.  
  848. #elif defined(_MIPS_ISA)
  849.     /*
  850.         MIPSpro compiler from Silicon Graphics Inc.
  851.     */
  852.     #define TARGET_CPU_PPC              0
  853.     #define TARGET_CPU_68K              0
  854.     #define TARGET_CPU_X86              0
  855.     #define TARGET_CPU_MIPS             1
  856.     #define TARGET_CPU_SPARC            0        
  857.     #define TARGET_CPU_ALPHA            0
  858.     #define TARGET_OS_MAC                0
  859.     #define TARGET_OS_WIN32                0
  860.     #define TARGET_OS_UNIX                1
  861.     #define TARGET_RT_LITTLE_ENDIAN        0
  862.     #define TARGET_RT_BIG_ENDIAN        1
  863.     #define TARGET_RT_MAC_CFM            0
  864.     #define TARGET_RT_MAC_68881            0
  865.     #define PRAGMA_IMPORT                0
  866.     #define PRAGMA_STRUCT_ALIGN            0
  867.     #define PRAGMA_ONCE                    0
  868.     #define PRAGMA_STRUCT_PACK            1
  869.     #define PRAGMA_STRUCT_PACKPUSH        0
  870.     #define PRAGMA_ENUM_PACK            0
  871.     #define PRAGMA_ENUM_ALWAYSINT        0
  872.     #define PRAGMA_ENUM_OPTIONS            0
  873.     #define FOUR_CHAR_CODE(x)            (x)
  874.     #define TYPE_EXTENDED                0
  875.     #define TYPE_LONGLONG                0
  876.     #define TYPE_BOOL                    0
  877.  
  878.  
  879. #elif defined(__sparc)
  880.     /*
  881.         SPARCompiler compiler from Sun Microsystems Inc.
  882.     */
  883.     #define TARGET_CPU_PPC              0
  884.     #define TARGET_CPU_68K              0
  885.     #define TARGET_CPU_X86              0
  886.     #define TARGET_CPU_MIPS             0
  887.     #define TARGET_CPU_SPARC            1        
  888.     #define TARGET_CPU_ALPHA            0
  889.     #define TARGET_OS_MAC                0
  890.     #define TARGET_OS_WIN32                0
  891.     #define TARGET_OS_UNIX                1
  892.     #define TARGET_RT_LITTLE_ENDIAN        0
  893.     #define TARGET_RT_BIG_ENDIAN        1
  894.     #define TARGET_RT_MAC_CFM            0
  895.     #define TARGET_RT_MAC_68881            0
  896.     #define PRAGMA_IMPORT                0
  897.     #define PRAGMA_STRUCT_ALIGN            0
  898.     #define PRAGMA_ONCE                    0
  899.     #define PRAGMA_STRUCT_PACK            1
  900.     #define PRAGMA_STRUCT_PACKPUSH        0
  901.     #define PRAGMA_ENUM_PACK            0
  902.     #define PRAGMA_ENUM_ALWAYSINT        0
  903.     #define PRAGMA_ENUM_OPTIONS            0
  904.     #define FOUR_CHAR_CODE(x)        (((unsigned long) ((x) & 0x000000FF)) << 24) \
  905.                                     | (((unsigned long) ((x) & 0x0000FF00)) << 8) \
  906.                                     | (((unsigned long) ((x) & 0x00FF0000)) >> 8) \
  907.                                     | (((unsigned long) ((x) & 0xFF000000)) >> 24)
  908.     #define TYPE_EXTENDED                0
  909.     #define TYPE_LONGLONG                0
  910.     #define TYPE_BOOL                    0
  911.  
  912.  
  913. #else
  914.     /*
  915.         Unknown compiler, perhaps set up from the command line (e.g. -d TARGET_CPU_MIPS , etc.)
  916.     */
  917.     #if defined(TARGET_CPU_PPC) && TARGET_CPU_PPC
  918.         #define TARGET_CPU_68K   0
  919.         #define TARGET_CPU_X86   0
  920.         #define TARGET_CPU_MIPS  0
  921.         #define TARGET_CPU_SPARC 0
  922.         #define TARGET_CPU_ALPHA 0
  923.     #elif defined(TARGET_CPU_68K) && TARGET_CPU_68K
  924.         #define TARGET_CPU_PPC   0
  925.         #define TARGET_CPU_X86   0
  926.         #define TARGET_CPU_MIPS  0
  927.         #define TARGET_CPU_SPARC 0
  928.         #define TARGET_CPU_ALPHA 0
  929.     #elif defined(TARGET_CPU_X86) && TARGET_CPU_X86
  930.         #define TARGET_CPU_PPC   0
  931.         #define TARGET_CPU_68K   0
  932.         #define TARGET_CPU_MIPS  0
  933.         #define TARGET_CPU_SPARC 0
  934.         #define TARGET_CPU_ALPHA 0
  935.     #elif defined(TARGET_CPU_MIPS) && TARGET_CPU_MIPS
  936.         #define TARGET_CPU_PPC   0
  937.         #define TARGET_CPU_68K   0
  938.         #define TARGET_CPU_X86   0
  939.         #define TARGET_CPU_SPARC 0
  940.         #define TARGET_CPU_ALPHA 0
  941.     #elif defined(TARGET_CPU_SPARC) && TARGET_CPU_SPARC
  942.         #define TARGET_CPU_PPC   0
  943.         #define TARGET_CPU_68K   0
  944.         #define TARGET_CPU_X86   0
  945.         #define TARGET_CPU_MIPS  0
  946.         #define TARGET_CPU_ALPHA 0
  947.     #elif defined(TARGET_CPU_ALPHA) && TARGET_CPU_ALPHA
  948.         #define TARGET_CPU_PPC   0
  949.         #define TARGET_CPU_68K   0
  950.         #define TARGET_CPU_X86   0
  951.         #define TARGET_CPU_MIPS  0
  952.         #define TARGET_CPU_SPARC 0
  953.  
  954.         
  955.     #else
  956.         /*
  957.             NOTE:    If your compiler errors out here then support for your compiler 
  958.                     has not yet been added to ConditionalMacros.h.  
  959.                     
  960.                     ConditionalMacros.h is designed to be plug-and-play.  It auto detects
  961.                     which compiler is being run and configures the TARGET_ conditionals
  962.                     appropriately.  
  963.                     
  964.                     The short term work around is to set the TARGET_CPU_ and TARGET_OS_
  965.                     on the command line to the compiler (e.g. d TARGET_CPU_MIPS -d TARGET_OS_UNIX)
  966.                     
  967.                     The long term solution is to add a new case to this file which
  968.                     auto detects your compiler and sets up the TARGET_ conditionals.
  969.                     If you do this, send the changes you made to devsupport@apple.com
  970.                     to get it integrated into the next release of ConditionalMacros.h.
  971.         */
  972.         #error ConditionalMacros.h: unknown compiler (see comment above)
  973.         #define TARGET_CPU_PPC   0
  974.         #define TARGET_CPU_68K   0
  975.         #define TARGET_CPU_X86   0
  976.         #define TARGET_CPU_MIPS  0
  977.         #define TARGET_CPU_SPARC 0
  978.         #define TARGET_CPU_ALPHA 0
  979.     #endif
  980.     
  981.  
  982.  
  983.     #if defined(TARGET_OS_MAC) && TARGET_OS_MAC
  984.         #define TARGET_OS_WIN32  0
  985.         #define TARGET_OS_UNIX   0
  986.     #elif defined(TARGET_OS_WIN32) && TARGET_OS_WIN32
  987.         #define TARGET_OS_MAC    0
  988.         #define TARGET_OS_UNIX   0
  989.     #elif defined(TARGET_OS_UNIX) && TARGET_OS_UNIX
  990.         #define TARGET_OS_MAC    0
  991.         #define TARGET_OS_WIN32  0
  992.     #elif TARGET_CPU_PPC || TARGET_CPU_68K
  993.         #define TARGET_OS_MAC    1
  994.         #define TARGET_OS_WIN32  0
  995.         #define TARGET_OS_UNIX   0
  996.     #else
  997.         #error ConditionalMacros.h: unknown target OS (see comment above)
  998.     #endif
  999.  
  1000.     #if !defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
  1001.         #if TARGET_OS_MAC
  1002.             #define TARGET_RT_LITTLE_ENDIAN        0
  1003.             #define TARGET_RT_BIG_ENDIAN        1
  1004.         #elif TARGET_OS_WIN32
  1005.             #define TARGET_RT_LITTLE_ENDIAN        1
  1006.             #define TARGET_RT_BIG_ENDIAN        0
  1007.         #endif
  1008.     #endif
  1009.         
  1010.     #if defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
  1011.         #define TARGET_RT_LITTLE_ENDIAN        !TARGET_RT_BIG_ENDIAN
  1012.     #elif !defined(TARGET_RT_BIG_ENDIAN) && defined(TARGET_RT_LITTLE_ENDIAN)
  1013.         #define TARGET_RT_BIG_ENDIAN        !TARGET_RT_LITTLE_ENDIAN
  1014.     #endif
  1015.     
  1016.     #if !defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
  1017.         #error unknown endianess of target processor
  1018.     #endif
  1019.  
  1020.     #ifndef TARGET_RT_MAC_CFM
  1021.     #define TARGET_RT_MAC_CFM            TARGET_CPU_PPC
  1022.     #endif
  1023.     #ifndef TARGET_RT_MAC_68881
  1024.     #define TARGET_RT_MAC_68881            0
  1025.     #endif
  1026.  
  1027.         
  1028.     #ifndef PRAGMA_IMPORT
  1029.     #define PRAGMA_IMPORT                0
  1030.     #endif
  1031.     #ifndef PRAGMA_STRUCT_ALIGN
  1032.     #define PRAGMA_STRUCT_ALIGN            0
  1033.     #endif
  1034.     #ifndef PRAGMA_ONCE
  1035.     #define PRAGMA_ONCE                    0
  1036.     #endif
  1037.     #ifndef PRAGMA_STRUCT_PACK
  1038.     #define PRAGMA_STRUCT_PACK            0
  1039.     #endif
  1040.     #ifndef PRAGMA_STRUCT_PACKPUSH
  1041.     #define PRAGMA_STRUCT_PACKPUSH        0
  1042.     #endif
  1043.     #ifndef PRAGMA_ENUM_PACK
  1044.     #define PRAGMA_ENUM_PACK            0
  1045.     #endif
  1046.     #ifndef PRAGMA_ENUM_ALWAYSINT
  1047.     #define PRAGMA_ENUM_ALWAYSINT        0
  1048.     #endif
  1049.     #ifndef PRAGMA_ENUM_OPTIONS
  1050.     #define PRAGMA_ENUM_OPTIONS            0
  1051.     #endif
  1052.     #ifndef FOUR_CHAR_CODE
  1053.     #define FOUR_CHAR_CODE(x)            (x)
  1054.     #endif
  1055.  
  1056.     #ifndef TYPE_EXTENDED
  1057.     #define TYPE_EXTENDED                0
  1058.     #endif
  1059.     #ifndef TYPE_LONGLONG
  1060.     #define TYPE_LONGLONG                0
  1061.     #endif
  1062.     #ifndef TYPE_BOOL
  1063.     #define TYPE_BOOL                    0
  1064.     #endif
  1065. #endif
  1066.  
  1067.  
  1068.  
  1069.  
  1070. /****************************************************************************************************
  1071.  
  1072.     EXTERN_API≈    
  1073.     These conditionals are used to specify the calling convention of a function.
  1074.     Mac classic 68K and Win32 each have two possible calling conventions:
  1075.  
  1076.         EXTERN_API                - Classic 68K pascal, Win32 __cdecl
  1077.         EXTERN_API_C            - Classic 68K C,      Win32 __cdecl
  1078.         EXTERN_API_STDCALL        - Classic 68K pascal, Win32 __stdcall
  1079.         EXTERN_API_C_STDCALL    - Classic 68K C,      Win32 __stdcall
  1080.  
  1081.  
  1082.     CALLBACK_API≈    
  1083.     These conditionals are used to specify the calling convention of a function pointer.
  1084.     Mac classic 68K and Win32 each have two possible calling conventions:
  1085.  
  1086.         CALLBACK_API            - Classic 68K pascal, Win32 __stdcall
  1087.         CALLBACK_API_C            - Classic 68K C,      Win32 __stdcall
  1088.         CALLBACK_API_STDCALL    - Classic 68K pascal, Win32 __cdecl
  1089.         CALLBACK_API_C_STDCALL    - Classic 68K C,      Win32 __cdecl
  1090.  
  1091. ****************************************************************************************************/
  1092. #if TARGET_OS_MAC
  1093.     /*
  1094.         Mac OS
  1095.     */
  1096.     #define EXTERN_API(_type)                        extern pascal _type        /* Note: all Mac OS compilers must be able to handle the pascal keyword */
  1097.     #define EXTERN_API_C(_type)                        extern _type
  1098.     #define EXTERN_API_STDCALL(_type)                extern pascal _type
  1099.     #define EXTERN_API_C_STDCALL(_type)                extern _type
  1100.     #define CALLBACK_API(_type, _name)                pascal _type (*_name)
  1101.     #define CALLBACK_API_C(_type, _name)            _type (*_name)
  1102.     #define CALLBACK_API_STDCALL(_type, _name)        pascal _type (*_name)
  1103.     #define CALLBACK_API_C_STDCALL(_type, _name)    _type (*_name)
  1104. #elif TARGET_OS_WIN32
  1105.     /*
  1106.         Win32 
  1107.     */
  1108.     #define EXTERN_API(_type)                        __declspec(dllimport) _type __cdecl
  1109.     #define EXTERN_API_C(_type)                        __declspec(dllimport) _type __cdecl
  1110.     #define EXTERN_API_STDCALL(_type)                __declspec(dllimport) _type __stdcall
  1111.     #define EXTERN_API_C_STDCALL(_type)                __declspec(dllimport) _type __stdcall
  1112.     #define CALLBACK_API(_type, _name)                _type (* __cdecl _name)
  1113.     #define CALLBACK_API_C(_type, _name)            _type (* __cdecl _name)
  1114.     #define CALLBACK_API_STDCALL(_type, _name)        _type (* __stdcall _name)
  1115.     #define CALLBACK_API_C_STDCALL(_type, _name)    _type (* __stdcall _name)
  1116. #else
  1117.     /*
  1118.         Unix or anything else
  1119.     */
  1120.     #define EXTERN_API(_type)                        extern _type
  1121.     #define EXTERN_API_C(_type)                        extern _type
  1122.     #define EXTERN_API_STDCALL(_type)                extern _type
  1123.     #define EXTERN_API_C_STDCALL(_type)                extern _type
  1124.     #define CALLBACK_API(_type, _name)                _type (*_name)
  1125.     #define CALLBACK_API_C(_type, _name)            _type (*_name)
  1126.     #define CALLBACK_API_STDCALL(_type, _name)        _type (*_name)
  1127.     #define CALLBACK_API_C_STDCALL(_type, _name)    _type (*_name)    
  1128. #endif
  1129.  
  1130.  
  1131. /****************************************************************************************************
  1132.     Backward compatibility for clients expecting 2.x version on ConditionalMacros.h
  1133.  
  1134.     GENERATINGPOWERPC        - Compiler is generating PowerPC instructions
  1135.     GENERATING68K            - Compiler is generating 68k family instructions
  1136.     GENERATING68881            - Compiler is generating mc68881 floating point instructions
  1137.     GENERATINGCFM            - Code being generated assumes CFM calling conventions
  1138.     CFMSYSTEMCALLS            - No A-traps.  Systems calls are made using CFM and UPP's
  1139.     PRAGMA_ALIGN_SUPPORTED    - Compiler supports: #pragma options align=mac68k/power/reset
  1140.     PRAGMA_IMPORT_SUPPORTED    - Compiler supports: #pragma import on/off/reset
  1141.  
  1142. ****************************************************************************************************/
  1143. #define GENERATINGPOWERPC TARGET_CPU_PPC
  1144. #define GENERATING68K TARGET_CPU_68K
  1145. #define GENERATING68881 TARGET_RT_MAC_68881
  1146. #define GENERATINGCFM TARGET_RT_MAC_CFM
  1147. #define CFMSYSTEMCALLS TARGET_RT_MAC_CFM
  1148. #define PRAGMA_ALIGN_SUPPORTED PRAGMA_STRUCT_ALIGN
  1149. #define PRAGMA_IMPORT_SUPPORTED PRAGMA_IMPORT
  1150. /*
  1151.     NOTE: The FOR_≈ conditionals were developed to produce integerated
  1152.           interface files for System 7 and Copland.  Now that Copland
  1153.           is canceled, all FOR_ conditionals have been removed from
  1154.           the interface files.  But, just in case you someone got an 
  1155.           interface file that uses them, the following sets the FOR_≈
  1156.           conditionals to a consistent, usable state.
  1157. */
  1158. #define FOR_OPAQUE_SYSTEM_DATA_STRUCTURES 0
  1159. #ifndef FOR_PTR_BASED_AE
  1160. #define FOR_PTR_BASED_AE 0
  1161. #endif  /*  ! defined(FOR_PTR_BASED_AE)  */
  1162.  
  1163. #define FOR_SYSTEM7_ONLY 1
  1164. #define FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED 1
  1165. #define FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE 1
  1166. #define FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE 1
  1167. #define FOR_SYSTEM8_COOPERATIVE 0
  1168. #define FOR_SYSTEM8_PREEMPTIVE 0
  1169.  
  1170.  
  1171.  
  1172. /****************************************************************************************************
  1173.  
  1174.     OLDROUTINENAMES            - "Old" names for Macintosh system calls are allowed in source code.
  1175.                               (e.g. DisposPtr instead of DisposePtr). The names of system routine
  1176.                               are now more sensitive to change because CFM binds by name.  In the 
  1177.                               past, system routine names were compiled out to just an A-Trap.  
  1178.                               Macros have been added that each map an old name to its new name.  
  1179.                               This allows old routine names to be used in existing source files,
  1180.                               but the macros only work if OLDROUTINENAMES is true.  This support
  1181.                               will be removed in the near future.  Thus, all source code should 
  1182.                               be changed to use the new names! You can set OLDROUTINENAMES to false
  1183.                               to see if your code has any old names left in it.
  1184.     
  1185.     OLDROUTINELOCATIONS     - "Old" location of Macintosh system calls are used.  For example, c2pstr 
  1186.                               has been moved from Strings to TextUtils.  It is conditionalized in
  1187.                               Strings with OLDROUTINELOCATIONS and in TextUtils with !OLDROUTINELOCATIONS.
  1188.                               This allows developers to upgrade to newer interface files without 
  1189.                               having to change the includes in their source code.  But, it allows
  1190.                               the slow migration of system calls to more understandable file locations.  
  1191.                               OLDROUTINELOCATIONS currently defaults to true, but eventually will 
  1192.                               default to false.
  1193.  
  1194. ****************************************************************************************************/
  1195. #ifndef OLDROUTINENAMES
  1196. #define OLDROUTINENAMES 0
  1197. #endif  /*  ! defined(OLDROUTINENAMES)  */
  1198.  
  1199. #ifndef OLDROUTINELOCATIONS
  1200. #define OLDROUTINELOCATIONS 0
  1201. #endif  /*  ! defined(OLDROUTINELOCATIONS)  */
  1202.  
  1203.  
  1204.  
  1205. /****************************************************************************************************
  1206.     C specific conditionals
  1207.  
  1208.     CGLUESUPPORTED            - Interface library will support "C glue" functions (function names
  1209.                               are: all lowercase, use C strings instead of pascal strings, use 
  1210.                               Point* instead of Point).
  1211.  
  1212. ****************************************************************************************************/
  1213. #ifndef CGLUESUPPORTED
  1214. #ifdef THINK_C
  1215. #define CGLUESUPPORTED 0
  1216. #else
  1217. #define CGLUESUPPORTED 1
  1218. #endif  /*  defined(THINK_C)  */
  1219.  
  1220. #endif  /*  ! defined(CGLUESUPPORTED)  */
  1221.  
  1222.  
  1223.  
  1224. /****************************************************************************************************
  1225.     The following macros isolate the use of 68K inlines in function prototypes.
  1226.     On the Mac OS under the Classic 68K runtime, function prototypes were followed
  1227.     by a list of 68K opcodes which the compiler inserted in the generated code instead
  1228.     of a JSR.  Under Classic 68K on the Mac OS, this macro will put the opcodes
  1229.     in the right syntax.  For all other OS's and runtimes the macro suppress the opcodes.
  1230.     Example:
  1231.     
  1232.         EXTERN_P void DrawPicture(PicHandle myPicture, const Rect *dstRect)
  1233.              ONEWORDINLINE(0xA8F6);
  1234.     
  1235. ****************************************************************************************************/
  1236.  
  1237. #if TARGET_OS_MAC && !TARGET_RT_MAC_CFM
  1238.     #define ONEWORDINLINE(w1) = w1
  1239.     #define TWOWORDINLINE(w1,w2) = {w1,w2}
  1240.     #define THREEWORDINLINE(w1,w2,w3) = {w1,w2,w3}
  1241.     #define FOURWORDINLINE(w1,w2,w3,w4)  = {w1,w2,w3,w4}
  1242.     #define FIVEWORDINLINE(w1,w2,w3,w4,w5) = {w1,w2,w3,w4,w5}
  1243.     #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6)     = {w1,w2,w3,w4,w5,w6}
  1244.     #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7)      = {w1,w2,w3,w4,w5,w6,w7}
  1245.     #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8)      = {w1,w2,w3,w4,w5,w6,w7,w8}
  1246.     #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9)      = {w1,w2,w3,w4,w5,w6,w7,w8,w9}
  1247.     #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10)  = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10}
  1248.     #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11)      = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11}
  1249.     #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}
  1250. #else
  1251.     #define ONEWORDINLINE(w1)
  1252.     #define TWOWORDINLINE(w1,w2)
  1253.     #define THREEWORDINLINE(w1,w2,w3)
  1254.     #define FOURWORDINLINE(w1,w2,w3,w4)
  1255.     #define FIVEWORDINLINE(w1,w2,w3,w4,w5)
  1256.     #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6)
  1257.     #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7)
  1258.     #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8)
  1259.     #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9)
  1260.     #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10)
  1261.     #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11)
  1262.     #define TWELVEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12)
  1263. #endif
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269. #endif /* __CONDITIONALMACROS__ */
  1270.  
  1271.