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