home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / MPW Oberon 2.1168 / OInterfaces / ConditionalMacros.mod < prev    next >
Encoding:
Text File  |  1995-08-07  |  5.7 KB  |  158 lines  |  [TEXT/MPS ]

  1. (*
  2.      File:        ConditionalMacros.mod
  3.  
  4.      Contains:    Compile time feature switches to achieve platform independent sources.
  5.  
  6.      Version:    Technology:    Universal Interface Files 2.0
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs.applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. *)
  19.  
  20. (*$TAGS-*)
  21. (*$CALLING PASCAL*)
  22. MODULE ConditionalMacros;
  23.  
  24. (*
  25.     This file sets up the following compiler independent conditionals*:
  26.     
  27.     GENERATINGPOWERPC        - Compiler is generating PowerPC instructions
  28.     GENERATING68K            - Compiler is generating 68k family instructions
  29.     GENERATING68881            - Compiler is generating mc68881 floating point instructions
  30.     GENERATINGCFM            - Code being generated assumes CFM calling conventions
  31.     CFMSYSTEMCALLS            - No A-traps.  Systems calls are made using CFM and UPP's
  32.     
  33.     SystemSevenFiveOrLater    - Compiled code will only be run on a System 7.5 or later Macintosh
  34.     SystemSevenOrLater        - Compiled code will only be run on a System 7.0 or later Macintosh
  35.     SystemSixOrLater        - Compiled code will only be run on a System 6.0 or later Macintosh
  36.                               A developer should set the appropriate flag on the compiler command-
  37.                               line or in a file processed before this file.  This will allow the
  38.                               certain optimizations to be made which can result in smaller, faster
  39.                               applications.
  40.     
  41.     CGLUESUPPORTED            - Interface library will support "C glue" functions (function names
  42.                               are*: all lowercase, use C strings instead of pascal strings, use 
  43.                               Types.Point* instead of Types.Point).
  44.  
  45.     OLDROUTINENAMES            - "Old" names for Macintosh system calls are allowed in source code.
  46.                               (e.g. DisposPtr instead of DisposePtr). The names of system routine
  47.                               are now more sensitive to change because CFM binds by name.  In the 
  48.                               past, system routine names were compiled out to just an A-Trap.  
  49.                               Macros have been added that each map an old name to its new name.  
  50.                               This allows old routine names to be used in existing source files,
  51.                               but the macros only work if OLDROUTINENAMES is true.  This support
  52.                               will be removed in the near future.  Thus, all source code should 
  53.                               be changed to use the new names! You can set OLDROUTINENAMES to false
  54.                               to see if your code has any old names left in it.
  55.     
  56.     OLDROUTINELOCATIONS     - "Old" location of Macintosh system calls are used.  For example, c2pstr 
  57.                               has been moved from Strings to TextUtils.  It is conditionalized in
  58.                               Strings with OLDROUTINELOCATIONS and in TextUtils with !OLDROUTINELOCATIONS.
  59.                               This allows developers to upgrade to newer interface files without suddenly
  60.                               all their code not compiling becuase of "incorrect" includes.  But, it
  61.                               allows the slow migration of system calls to more understandable file
  62.                               locations.  OLDROUTINELOCATIONS currently defaults to true, but eventually
  63.                               will default to false.
  64.     
  65.     PRAGMA_ALIGN_SUPPORTED    - Compiler supports "#pragma align=..." directives. The only compilers that
  66.                               can get by without supporting the pragma are old classic 68K compilers
  67.                               that will only be used to compile older structs that have 68K alignment
  68.                               anyways.  
  69.     
  70.     PRAGMA_IMPORT_SUPPORTED    - Compiler supports "#pragma import on/off" directives.  These directives
  71.                               were introduced with the SC compiler which supports CFM 68K.  The directive
  72.                               is used to tell the compiler which functions will be called through a 
  73.                               transition vector (instead of a simple PC-relative offset).  This allows 
  74.                               the compiler to generate better code.  Since System Software functions are
  75.                               implemented as shared libraries and called through transition vectors,
  76.                               all System Software functions are declared with "#pragma import on".
  77.                               
  78.     
  79.     There are some invariants among the conditionals*:
  80.     
  81.     GENERATINGPOWERPC != GENERATING68K
  82.     GENERATING68881 => GENERATING68K
  83.     GENERATINGPOWERPC => GENERATINGCFM
  84.     GENERATINGPOWERPC => CFMSYSTEMCALLS
  85.     CFMSYSTEMCALLS => GENERATINGCFM
  86.     GENERATINGPOWERPC => SystemSevenOrLater
  87.     SystemSevenFiveOrLater => SystemSevenOrLater
  88.     SystemSevenOrLater => SystemSixOrLater
  89.     PRAGMA_IMPORT_SUPPORTED => CFMSYSTEMCALLS
  90.     
  91. *)
  92. (*
  93.  
  94.     Set up GENERATINGPOWERPC and GENERATING68K
  95.  
  96. *)
  97. (*$IF UNDEFINED LSPWRP *)
  98. (*$SET LSPWRP FALSE*)
  99. (*$END*)
  100. (*$IF UNDEFINED LSP68K *)
  101. (*$SET LSP68K NOT LSPWRP*)
  102. (*$END*)
  103. (*$IF UNDEFINED GENERATINGPOWERPC *)
  104. (*$SET GENERATINGPOWERPC LSPWRP*)
  105. (*$END*)
  106. (*$IF UNDEFINED GENERATING68K *)
  107. (*$SET GENERATING68K LSP68K*)
  108. (*$END*)
  109. (*
  110.  
  111.     Set up GENERATING68881 
  112.  
  113. *)
  114. (*$IF GENERATING68K AND OPTION(mc68881) *)
  115. (*$SET GENERATING68881 TRUE *)
  116. (*$END*)
  117. (*$IF UNDEFINED GENERATING68881 *)
  118. (*$SET GENERATING68881 FALSE*)
  119. (*$END*)
  120. (*
  121.  
  122.     Set up GENERATINGCFM and  CFMSYSTEMCALLS
  123.  
  124. *)
  125. (*$SET GENERATINGCFM GENERATINGPOWERPC*)
  126. (*$SET CFMSYSTEMCALLS GENERATINGPOWERPC*)
  127. (*
  128.  
  129.     Set up SystemSevenFiveOrLater, SystemSevenOrLater, and SystemSixOrLater
  130.  
  131. *)
  132. (*$IF UNDEFINED SystemSevenFiveOrLater *)
  133. (*$SET SystemSevenFiveOrLater FALSE*)
  134. (*$END*)
  135. (*$IF UNDEFINED SystemSevenOrLater *)
  136.  (*$IF GENERATINGCFM *)
  137. (*$SET SystemSevenOrLater TRUE*)
  138.  (*$ELSE*)
  139. (*$SET SystemSevenOrLater SystemSevenFiveOrLater*)
  140.  (*$END*)
  141. (*$END*)
  142. (*$IF UNDEFINED SystemSixOrLater *)
  143. (*$SET SystemSixOrLater SystemSevenOrLater*)
  144. (*$END*)
  145. (*
  146.  
  147.     Set up OLDROUTINENAMES and OLDROUTINELOCATIONS
  148.  
  149. *)
  150. (*$IF UNDEFINED OLDROUTINENAMES *)
  151. (*$SET OLDROUTINENAMES TRUE*)
  152. (*$END*)
  153. (*$IF UNDEFINED OLDROUTINELOCATIONS *)
  154. (*$SET OLDROUTINELOCATIONS TRUE*)
  155. (*$END*)
  156.  
  157.  END ConditionalMacros.
  158.