ConditionalMacros.pas 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. {
  2. File: ConditionalMacros.p
  3. Contains: Set up for compiler independent conditionals
  4. Version: Technology: Universal Interface Files
  5. Release: Universal Interfaces 3.4.2
  6. Copyright: © 1993-2002 by Apple Computer, Inc., all rights reserved
  7. Bugs?: For bug reports, consult the following page on
  8. the World Wide Web:
  9. http://www.freepascal.org/bugs.html
  10. }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit ConditionalMacros;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. {$ALIGN MAC68K}
  92. {***************************************************************************************************
  93. UNIVERSAL_INTERFACES_VERSION
  94. 0x0400 --> version 4.0 (Mac OS X only)
  95. 0x0341 --> version 3.4.1
  96. 0x0340 --> version 3.4
  97. 0x0331 --> version 3.3.1
  98. 0x0330 --> version 3.3
  99. 0x0320 --> version 3.2
  100. 0x0310 --> version 3.1
  101. 0x0301 --> version 3.0.1
  102. 0x0300 --> version 3.0
  103. 0x0210 --> version 2.1
  104. This conditional did not exist prior to version 2.1
  105. ***************************************************************************************************}
  106. {***************************************************************************************************
  107. TARGET_CPU_Å
  108. These conditionals specify which microprocessor instruction set is being
  109. generated. At most one of these is true, the rest are false.
  110. TARGET_CPU_PPC - Compiler is generating PowerPC instructions
  111. TARGET_CPU_68K - Compiler is generating 680x0 instructions
  112. TARGET_CPU_X86 - Compiler is generating x86 instructions
  113. TARGET_CPU_MIPS - Compiler is generating MIPS instructions
  114. TARGET_CPU_SPARC - Compiler is generating Sparc instructions
  115. TARGET_CPU_ALPHA - Compiler is generating Dec Alpha instructions
  116. TARGET_OS_Å
  117. These conditionals specify in which Operating System the generated code will
  118. run. At most one of the these is true, the rest are false.
  119. TARGET_OS_MAC - Generate code will run under Mac OS
  120. TARGET_OS_WIN32 - Generate code will run under 32-bit Windows
  121. TARGET_OS_UNIX - Generate code will run under some unix
  122. TARGET_RT_Å
  123. These conditionals specify in which runtime the generated code will
  124. run. This is needed when the OS and CPU support more than one runtime
  125. (e.g. MacOS on 68K supports CFM68K and Classic 68k).
  126. TARGET_RT_LITTLE_ENDIAN - Generated code uses little endian format for integers
  127. TARGET_RT_BIG_ENDIAN - Generated code uses big endian format for integers
  128. TARGET_RT_MAC_CFM - TARGET_OS_MAC is true and CFM68K or PowerPC CFM (TVectors) are used
  129. TARGET_RT_MAC_MACHO - TARGET_OS_MAC is true and Mach-O style runtime
  130. TARGET_RT_MAC_68881 - TARGET_OS_MAC is true and 68881 floating point instructions used
  131. TARGET__API_Å_Å
  132. These conditionals are used to differentiate between sets of API's on the same
  133. processor under the same OS. The first section after _API_ is the OS. The
  134. second section is the API set. Unlike TARGET_OS_ and TARGET_CPU_, these
  135. conditionals are not mutally exclusive. This file will attempt to auto-configure
  136. all TARGET_API_Å_Å values, but will often need a TARGET_API_Å_Å value predefined
  137. in order to disambiguate.
  138. TARGET_API_MAC_OS8 - Code is being compiled to run on System 7 through Mac OS 8.x
  139. TARGET_API_MAC_CARBON - Code is being compiled to run on Mac OS 8 and Mac OS X via CarbonLib
  140. TARGET_API_MAC_OSX - Code is being compiled to run on Mac OS X
  141. PRAGMA_Å
  142. These conditionals specify whether the compiler supports particular #pragma's
  143. PRAGMA_IMPORT - Compiler supports: #pragma import on/off/reset
  144. PRAGMA_ONCE - Compiler supports: #pragma once
  145. PRAGMA_STRUCT_ALIGN - Compiler supports: #pragma options align=mac68k/power/reset
  146. PRAGMA_STRUCT_PACK - Compiler supports: #pragma pack(n)
  147. PRAGMA_STRUCT_PACKPUSH - Compiler supports: #pragma pack(push, n)/pack(pop)
  148. PRAGMA_ENUM_PACK - Compiler supports: #pragma options(!pack_enums)
  149. PRAGMA_ENUM_ALWAYSINT - Compiler supports: #pragma enumsalwaysint on/off/reset
  150. PRAGMA_ENUM_OPTIONS - Compiler supports: #pragma options enum=int/small/reset
  151. FOUR_CHAR_CODE
  152. This conditional does the proper byte swapping to assue that a four character code (e.g. 'TEXT')
  153. is compiled down to the correct value on all compilers.
  154. $61626364 (* 'abcd' *) - Convert a four-char-code to the correct 32-bit value
  155. TYPE_Å
  156. These conditionals specify whether the compiler supports particular types.
  157. TYPE_LONGLONG - Compiler supports "long long" 64-bit integers
  158. TYPE_BOOL - Compiler supports "bool"
  159. TYPE_EXTENDED - Compiler supports "extended" 80/96 bit floating point
  160. TYPE_LONGDOUBLE_IS_DOUBLE - Compiler implements "long double" same as "double"
  161. FUNCTION_Å
  162. These conditionals specify whether the compiler supports particular language extensions
  163. to function prototypes and definitions.
  164. FUNCTION_PASCAL - Compiler supports "pascal void Foo()"
  165. FUNCTION_DECLSPEC - Compiler supports "__declspec(xxx) void Foo()"
  166. FUNCTION_WIN32CC - Compiler supports "void __cdecl Foo()" and "void __stdcall Foo()"
  167. ***************************************************************************************************}
  168. {***************************************************************************************************
  169. Backward compatibility for clients expecting 2.x version on ConditionalMacros.h
  170. GENERATINGPOWERPC - Compiler is generating PowerPC instructions
  171. GENERATING68K - Compiler is generating 68k family instructions
  172. GENERATING68881 - Compiler is generating mc68881 floating point instructions
  173. GENERATINGCFM - Code being generated assumes CFM calling conventions
  174. CFMSYSTEMCALLS - No A-traps. Systems calls are made using CFM and UPP's
  175. PRAGMA_ALIGN_SUPPORTED - Compiler supports: #pragma options align=mac68k/power/reset
  176. PRAGMA_IMPORT_SUPPORTED - Compiler supports: #pragma import on/off/reset
  177. CGLUESUPPORTED - Clients can use all lowercase toolbox functions that take C strings instead of pascal strings
  178. ***************************************************************************************************}
  179. {***************************************************************************************************
  180. OLDROUTINENAMES - "Old" names for Macintosh system calls are allowed in source code.
  181. (e.g. DisposPtr instead of DisposePtr). The names of system routine
  182. are now more sensitive to change because CFM binds by name. In the
  183. past, system routine names were compiled out to just an A-Trap.
  184. Macros have been added that each map an old name to its new name.
  185. This allows old routine names to be used in existing source files,
  186. but the macros only work if OLDROUTINENAMES is true. This support
  187. will be removed in the near future. Thus, all source code should
  188. be changed to use the new names! You can set OLDROUTINENAMES to false
  189. to see if your code has any old names left in it.
  190. ***************************************************************************************************}
  191. {***************************************************************************************************
  192. TARGET_CARBON - default: false. Switches all of the above as described. Overrides all others
  193. - NOTE: If you set TARGET_CARBON to 1, then the other switches will be setup by
  194. ConditionalMacros, and should not be set manually.
  195. If you wish to do development for pre-Carbon Systems, you can set the following:
  196. OPAQUE_TOOLBOX_STRUCTS - default: false. True for Carbon builds, hides struct fields.
  197. OPAQUE_UPP_TYPES - default: false. True for Carbon builds, UPP types are unique and opaque.
  198. ACCESSOR_CALLS_ARE_FUNCTIONS - default: false. True for Carbon builds, enables accessor functions.
  199. CALL_NOT_IN_CARBON - default: true. False for Carbon builds, hides calls not supported in Carbon.
  200. Specifically, if you are building a non-Carbon application (one that links against InterfaceLib)
  201. but you wish to use some of the accessor functions, you can set ACCESSOR_CALLS_ARE_FUNCTIONS to 1
  202. and link with CarbonAccessors.o, which implements just the accessor functions. This will help you
  203. preserve source compatibility between your Carbon and non-Carbon application targets.
  204. MIXEDMODE_CALLS_ARE_FUNCTIONS - deprecated.
  205. ***************************************************************************************************}
  206. end.