Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1866 lines
71 KiB

  1. /*
  2. File: ConditionalMacros.h
  3. Contains: Set up for compiler independent conditionals
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1993-2001 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __CONDITIONALMACROS__
  11. #define __CONDITIONALMACROS__
  12. /****************************************************************************************************
  13. UNIVERSAL_INTERFACES_VERSION
  14. 0x0400 --> version 4.0 (Mac OS X only)
  15. 0x0335 --> version 3.4
  16. 0x0331 --> version 3.3.1
  17. 0x0330 --> version 3.3
  18. 0x0320 --> version 3.2
  19. 0x0310 --> version 3.1
  20. 0x0301 --> version 3.0.1
  21. 0x0300 --> version 3.0
  22. 0x0210 --> version 2.1
  23. This conditional did not exist prior to version 2.1
  24. ****************************************************************************************************/
  25. #define UNIVERSAL_INTERFACES_VERSION 0x0340
  26. #define UNIVERSAL_INTERFACES_SEED_VERSION 22
  27. /****************************************************************************************************
  28. TARGET_CPU_*
  29. These conditionals specify which microprocessor instruction set is being
  30. generated. At most one of these is true, the rest are false.
  31. TARGET_CPU_PPC - Compiler is generating PowerPC instructions
  32. TARGET_CPU_68K - Compiler is generating 680x0 instructions
  33. TARGET_CPU_X86 - Compiler is generating x86 instructions
  34. TARGET_CPU_MIPS - Compiler is generating MIPS instructions
  35. TARGET_CPU_SPARC - Compiler is generating Sparc instructions
  36. TARGET_CPU_ALPHA - Compiler is generating Dec Alpha instructions
  37. TARGET_OS_*
  38. These conditionals specify in which Operating System the generated code will
  39. run. At most one of the these is true, the rest are false.
  40. TARGET_OS_MAC - Generate code will run under Mac OS
  41. TARGET_OS_WIN32 - Generate code will run under 32-bit Windows
  42. TARGET_OS_UNIX - Generate code will run under some unix
  43. TARGET_RT_*
  44. These conditionals specify in which runtime the generated code will
  45. run. This is needed when the OS and CPU support more than one runtime
  46. (e.g. MacOS on 68K supports CFM68K and Classic 68k).
  47. TARGET_RT_LITTLE_ENDIAN - Generated code uses little endian format for integers
  48. TARGET_RT_BIG_ENDIAN - Generated code uses big endian format for integers
  49. TARGET_RT_MAC_CFM - TARGET_OS_MAC is true and CFM68K or PowerPC CFM (TVectors) are used
  50. TARGET_RT_MAC_MACHO - TARGET_OS_MAC is true and Mach-O style runtime
  51. TARGET_RT_MAC_68881 - TARGET_OS_MAC is true and 68881 floating point instructions used
  52. TARGET__API_*_*
  53. These conditionals are used to differentiate between sets of API's on the same
  54. processor under the same OS. The first section after _API_ is the OS. The
  55. second section is the API set. Unlike TARGET_OS_ and TARGET_CPU_, these
  56. conditionals are not mutally exclusive. This file will attempt to auto-configure
  57. all TARGET_API_*_* values, but will often need a TARGET_API_*_* value predefined
  58. in order to disambiguate.
  59. TARGET_API_MAC_OS8 - Code is being compiled to run on System 7 through Mac OS 8.x
  60. TARGET_API_MAC_CARBON - Code is being compiled to run on Mac OS 8 and Mac OS X via CarbonLib
  61. TARGET_API_MAC_OSX - Code is being compiled to run on Mac OS X
  62. PRAGMA_*
  63. These conditionals specify whether the compiler supports particular #pragma's
  64. PRAGMA_IMPORT - Compiler supports: #pragma import on/off/reset
  65. PRAGMA_ONCE - Compiler supports: #pragma once
  66. PRAGMA_STRUCT_ALIGN - Compiler supports: #pragma options align=mac68k/power/reset
  67. PRAGMA_STRUCT_PACK - Compiler supports: #pragma pack(n)
  68. PRAGMA_STRUCT_PACKPUSH - Compiler supports: #pragma pack(push, n)/pack(pop)
  69. PRAGMA_ENUM_PACK - Compiler supports: #pragma options(!pack_enums)
  70. PRAGMA_ENUM_ALWAYSINT - Compiler supports: #pragma enumsalwaysint on/off/reset
  71. PRAGMA_ENUM_OPTIONS - Compiler supports: #pragma options enum=int/small/reset
  72. FOUR_CHAR_CODE
  73. This conditional does the proper byte swapping to assue that a four character code (e.g. 'TEXT')
  74. is compiled down to the correct value on all compilers.
  75. FOUR_CHAR_CODE('abcd') - Convert a four-char-code to the correct 32-bit value
  76. TYPE_*
  77. These conditionals specify whether the compiler supports particular types.
  78. TYPE_LONGLONG - Compiler supports "long long" 64-bit integers
  79. TYPE_BOOL - Compiler supports "bool"
  80. TYPE_EXTENDED - Compiler supports "extended" 80/96 bit floating point
  81. TYPE_LONGDOUBLE_IS_DOUBLE - Compiler implements "long double" same as "double"
  82. FUNCTION_*
  83. These conditionals specify whether the compiler supports particular language extensions
  84. to function prototypes and definitions.
  85. FUNCTION_PASCAL - Compiler supports "pascal void Foo()"
  86. FUNCTION_DECLSPEC - Compiler supports "__declspec(xxx) void Foo()"
  87. FUNCTION_WIN32CC - Compiler supports "void __cdecl Foo()" and "void __stdcall Foo()"
  88. ****************************************************************************************************/
  89. #if defined(__MRC__)
  90. /*
  91. MrC[pp] compiler from Apple Computer, Inc.
  92. */
  93. #define TARGET_CPU_PPC 1
  94. #define TARGET_CPU_68K 0
  95. #define TARGET_CPU_X86 0
  96. #define TARGET_CPU_MIPS 0
  97. #define TARGET_CPU_SPARC 0
  98. #define TARGET_CPU_ALPHA 0
  99. #define TARGET_OS_MAC 1
  100. #define TARGET_OS_WIN32 0
  101. #define TARGET_OS_UNIX 0
  102. #define TARGET_RT_LITTLE_ENDIAN 0
  103. #define TARGET_RT_BIG_ENDIAN 1
  104. #define TARGET_RT_MAC_CFM 1
  105. #define TARGET_RT_MAC_MACHO 0
  106. #define TARGET_RT_MAC_68881 0
  107. #if (__MRC__ > 0x0200) && (__MRC__ < 0x0700)
  108. #define PRAGMA_IMPORT 1
  109. #else
  110. #define PRAGMA_IMPORT 0
  111. #endif
  112. #define PRAGMA_STRUCT_ALIGN 1
  113. #define PRAGMA_ONCE 1
  114. #define PRAGMA_STRUCT_PACK 0
  115. #define PRAGMA_STRUCT_PACKPUSH 0
  116. #define PRAGMA_ENUM_PACK 1
  117. #define PRAGMA_ENUM_ALWAYSINT 0
  118. #define PRAGMA_ENUM_OPTIONS 0
  119. #define FOUR_CHAR_CODE(x) (x)
  120. #if (__MRC__ > 0x0300) && (__MRC__ < 0x0700)
  121. #if __option(longlong)
  122. #define TYPE_LONGLONG 1
  123. #else
  124. #define TYPE_LONGLONG 0
  125. #endif
  126. #if __option(bool)
  127. #define TYPE_BOOL 1
  128. #else
  129. #define TYPE_BOOL 0
  130. #endif
  131. #define SLASH_INCLUDES_UNSUPPORTED !__option(unix_includes)
  132. #else
  133. #define TYPE_LONGLONG 0
  134. #define TYPE_BOOL 0
  135. #define SLASH_INCLUDES_UNSUPPORTED 1
  136. #endif
  137. #define TYPE_EXTENDED 0
  138. #define TYPE_LONGDOUBLE_IS_DOUBLE 0
  139. #define FUNCTION_PASCAL 1
  140. #define FUNCTION_DECLSPEC 0
  141. #define FUNCTION_WIN32CC 0
  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. #define TARGET_RT_MAC_MACHO 0
  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. #define TYPE_LONGLONG 0
  190. #define TYPE_EXTENDED 1
  191. #define TYPE_LONGDOUBLE_IS_DOUBLE 0
  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. #if TARGET_RT_MAC_CFM
  202. #define FUNCTION_PASCAL 0
  203. #else
  204. #define FUNCTION_PASCAL 1
  205. #endif
  206. #define FUNCTION_DECLSPEC 0
  207. #define FUNCTION_WIN32CC 0
  208. #define SLASH_INCLUDES_UNSUPPORTED !__option(unix_includes)
  209. #elif defined(__MWERKS__)
  210. /*
  211. CodeWarrior compiler from Metrowerks, Inc.
  212. */
  213. #if (__MWERKS__ < 0x0900) || macintosh
  214. #define TARGET_OS_MAC 1
  215. #define TARGET_OS_WIN32 0
  216. #define TARGET_OS_UNIX 0
  217. #define TARGET_CPU_X86 0
  218. #define TARGET_CPU_MIPS 0
  219. #define TARGET_CPU_SPARC 0
  220. #define TARGET_CPU_ALPHA 0
  221. #define TARGET_RT_LITTLE_ENDIAN 0
  222. #define TARGET_RT_BIG_ENDIAN 1
  223. #if powerc
  224. #define TARGET_CPU_PPC 1
  225. #define TARGET_CPU_68K 0
  226. #define TARGET_RT_MAC_CFM 1
  227. #define TARGET_RT_MAC_MACHO 0
  228. #define TARGET_RT_MAC_68881 0
  229. #define TYPE_LONGDOUBLE_IS_DOUBLE 1
  230. #else
  231. #define TARGET_CPU_PPC 0
  232. #define TARGET_CPU_68K 1
  233. #if defined(__CFM68K__)
  234. #define TARGET_RT_MAC_CFM 1
  235. #else
  236. #define TARGET_RT_MAC_CFM 0
  237. #endif
  238. #define TARGET_RT_MAC_MACHO 0
  239. #if __MC68881__
  240. #define TARGET_RT_MAC_68881 1
  241. #else
  242. #define TARGET_RT_MAC_68881 0
  243. #endif
  244. #if __option(IEEEdoubles)
  245. #define TYPE_LONGDOUBLE_IS_DOUBLE 0
  246. #else
  247. #define TYPE_LONGDOUBLE_IS_DOUBLE 1
  248. #endif
  249. #endif
  250. #define PRAGMA_ONCE 1
  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_STRUCT_PACK 0
  258. #define PRAGMA_STRUCT_PACKPUSH 0
  259. #define PRAGMA_ENUM_PACK 0
  260. #define PRAGMA_ENUM_ALWAYSINT 1
  261. #define PRAGMA_ENUM_OPTIONS 0
  262. #if __option(enumsalwaysint) && __option(ANSI_strict)
  263. #define FOUR_CHAR_CODE(x) ((long)(x)) /* otherwise compiler will complain about values with high bit set */
  264. #else
  265. #define FOUR_CHAR_CODE(x) (x)
  266. #endif
  267. #if TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  268. #define FUNCTION_PASCAL 1
  269. #else
  270. #define FUNCTION_PASCAL 1
  271. #endif
  272. #if (__MWERKS__ >= 0x2000)
  273. #define FUNCTION_DECLSPEC 1
  274. #else
  275. #define FUNCTION_DECLSPEC 0
  276. #endif
  277. #define FUNCTION_WIN32CC 0
  278. #elif (__MWERKS__ >= 0x0900) && __INTEL__
  279. #define TARGET_CPU_PPC 0
  280. #define TARGET_CPU_68K 0
  281. #define TARGET_CPU_X86 1
  282. #define TARGET_CPU_MIPS 0
  283. #define TARGET_CPU_SPARC 0
  284. #define TARGET_CPU_ALPHA 0
  285. #define TARGET_OS_MAC 0
  286. #define TARGET_OS_WIN32 1
  287. #define TARGET_OS_UNIX 0
  288. #define TARGET_RT_LITTLE_ENDIAN 1
  289. #define TARGET_RT_BIG_ENDIAN 0
  290. #define __COREAUDIO_USE_FLAT_INCLUDES__ 1
  291. #define PRAGMA_ONCE 1
  292. #define PRAGMA_IMPORT 0
  293. #define PRAGMA_STRUCT_ALIGN 0
  294. #define PRAGMA_STRUCT_PACK 1
  295. #define PRAGMA_STRUCT_PACKPUSH 1
  296. #define PRAGMA_ENUM_PACK 0
  297. #define PRAGMA_ENUM_ALWAYSINT 1
  298. #define PRAGMA_ENUM_OPTIONS 0
  299. #define FOUR_CHAR_CODE(x) (x)
  300. #define FUNCTION_PASCAL 0
  301. #ifndef FUNCTION_DECLSPEC /* allow use of __declspec(dllimport) to be enabled */
  302. #define FUNCTION_DECLSPEC 0 /* QuickTime for Windows cannot use dllimport */
  303. #endif
  304. #ifndef FUNCTION_WIN32CC /* allow calling convention to be overriddden */
  305. #define FUNCTION_WIN32CC 1
  306. #endif
  307. #define TYPE_LONGDOUBLE_IS_DOUBLE 1
  308. #elif (__MWERKS__ >= 0x1900) && __MIPS__
  309. #define TARGET_CPU_PPC 0
  310. #define TARGET_CPU_68K 0
  311. #define TARGET_CPU_X86 0
  312. #define TARGET_CPU_MIPS 1
  313. #define TARGET_CPU_SPARC 0
  314. #define TARGET_CPU_ALPHA 0
  315. #define TARGET_OS_MAC 0
  316. #define TARGET_OS_WIN32 0
  317. #define TARGET_OS_UNIX 1
  318. #if __option(little_endian)
  319. #define TARGET_RT_LITTLE_ENDIAN 1
  320. #define TARGET_RT_BIG_ENDIAN 0
  321. #else
  322. #define TARGET_RT_LITTLE_ENDIAN 0
  323. #define TARGET_RT_BIG_ENDIAN 1
  324. #endif
  325. #define PRAGMA_ONCE 1
  326. #define PRAGMA_IMPORT 0
  327. #define PRAGMA_STRUCT_ALIGN 0
  328. #define PRAGMA_STRUCT_PACK 1
  329. #define PRAGMA_STRUCT_PACKPUSH 0
  330. #define PRAGMA_ENUM_PACK 0
  331. #define PRAGMA_ENUM_ALWAYSINT 1
  332. #define PRAGMA_ENUM_OPTIONS 0
  333. #define FOUR_CHAR_CODE(x) (x)
  334. #define FUNCTION_PASCAL 0
  335. #define FUNCTION_DECLSPEC 0
  336. #define FUNCTION_WIN32CC 0
  337. #define TYPE_LONGDOUBLE_IS_DOUBLE 1
  338. #elif (__MWERKS__ >= 0x2110) && __MACH__
  339. #define TARGET_CPU_PPC 1
  340. #define TARGET_CPU_68K 0
  341. #define TARGET_CPU_X86 0
  342. #define TARGET_CPU_MIPS 0
  343. #define TARGET_CPU_SPARC 0
  344. #define TARGET_CPU_ALPHA 0
  345. #define TARGET_OS_MAC 1
  346. #define TARGET_OS_WIN32 0
  347. #define TARGET_OS_UNIX 0
  348. #if __option(little_endian)
  349. #define TARGET_RT_LITTLE_ENDIAN 1
  350. #define TARGET_RT_BIG_ENDIAN 0
  351. #else
  352. #define TARGET_RT_LITTLE_ENDIAN 0
  353. #define TARGET_RT_BIG_ENDIAN 1
  354. #endif
  355. #define TARGET_RT_MAC_CFM 0
  356. #define TARGET_RT_MAC_MACHO 1
  357. #define TARGET_RT_MAC_68881 0
  358. #define PRAGMA_ONCE 1
  359. #define PRAGMA_IMPORT 0
  360. #define PRAGMA_STRUCT_ALIGN 1
  361. #define PRAGMA_STRUCT_PACK 1
  362. #define PRAGMA_STRUCT_PACKPUSH 0
  363. #define PRAGMA_ENUM_PACK 0
  364. #define PRAGMA_ENUM_ALWAYSINT 1
  365. #define PRAGMA_ENUM_OPTIONS 0
  366. #define FOUR_CHAR_CODE(x) (x)
  367. #define FUNCTION_PASCAL 1
  368. #define FUNCTION_DECLSPEC 1
  369. #define FUNCTION_WIN32CC 0
  370. #define TYPE_LONGDOUBLE_IS_DOUBLE 1
  371. #else
  372. #error unknown Metrowerks compiler
  373. #endif
  374. #if (__MWERKS__ >= 0x1100)
  375. #if __option(longlong)
  376. #define TYPE_LONGLONG 1
  377. #else
  378. #define TYPE_LONGLONG 0
  379. #endif
  380. #else
  381. #define TYPE_LONGLONG 0
  382. #endif
  383. #if (__MWERKS__ >= 0x1000)
  384. #if __option(bool)
  385. #define TYPE_BOOL 1
  386. #else
  387. #define TYPE_BOOL 0
  388. #endif
  389. #else
  390. #define TYPE_BOOL 0
  391. #endif
  392. #define TYPE_EXTENDED 0
  393. #define SLASH_INCLUDES_UNSUPPORTED 1
  394. #elif defined(SYMANTEC_CPLUS) || defined(SYMANTEC_C)
  395. /*
  396. C and C++ compiler from Symantec, Inc.
  397. */
  398. #define TARGET_OS_MAC 1
  399. #define TARGET_OS_WIN32 0
  400. #define TARGET_OS_UNIX 0
  401. #define TARGET_CPU_X86 0
  402. #define TARGET_CPU_MIPS 0
  403. #define TARGET_CPU_SPARC 0
  404. #define TARGET_CPU_ALPHA 0
  405. #define TARGET_RT_LITTLE_ENDIAN 0
  406. #define TARGET_RT_BIG_ENDIAN 1
  407. #if powerc
  408. #define TARGET_CPU_PPC 1
  409. #define TARGET_CPU_68K 0
  410. #define TARGET_RT_MAC_CFM 1
  411. #define TARGET_RT_MAC_MACHO 0
  412. #define TARGET_RT_MAC_68881 0
  413. #else
  414. #define TARGET_CPU_PPC 0
  415. #define TARGET_CPU_68K 1
  416. #if defined(__CFM68K)
  417. #define TARGET_RT_MAC_CFM 1
  418. #else
  419. #define TARGET_RT_MAC_CFM 0
  420. #endif
  421. #define TARGET_RT_MAC_MACHO 0
  422. #if mc68881
  423. #define TARGET_RT_MAC_68881 1
  424. #else
  425. #define TARGET_RT_MAC_68881 0
  426. #endif
  427. #endif
  428. #define PRAGMA_IMPORT 0
  429. #define PRAGMA_ONCE 1
  430. #define PRAGMA_STRUCT_ALIGN 1
  431. #define PRAGMA_STRUCT_PACK 0
  432. #define PRAGMA_STRUCT_PACKPUSH 0
  433. #define PRAGMA_ENUM_PACK 1
  434. #define PRAGMA_ENUM_ALWAYSINT 0
  435. #define PRAGMA_ENUM_OPTIONS 0
  436. #define FOUR_CHAR_CODE(x) (x)
  437. #if __useAppleExts__
  438. #define TYPE_EXTENDED 1
  439. #else
  440. #define TYPE_EXTENDED 0
  441. #endif
  442. #define TYPE_LONGLONG 0
  443. #define TYPE_BOOL 0
  444. #define TYPE_LONGDOUBLE_IS_DOUBLE 1
  445. #define FUNCTION_PASCAL 0
  446. #define FUNCTION_DECLSPEC 0
  447. #define FUNCTION_WIN32CC 0
  448. #define SLASH_INCLUDES_UNSUPPORTED 1
  449. #elif defined(THINK_C)
  450. /*
  451. THINK C compiler from Symantec, Inc. << WARNING: Unsupported Compiler >>
  452. */
  453. #define TARGET_CPU_PPC 0
  454. #define TARGET_CPU_68K 1
  455. #define TARGET_CPU_X86 0
  456. #define TARGET_CPU_MIPS 0
  457. #define TARGET_CPU_SPARC 0
  458. #define TARGET_CPU_ALPHA 0
  459. #define TARGET_OS_MAC 1
  460. #define TARGET_OS_WIN32 0
  461. #define TARGET_OS_UNIX 0
  462. #define TARGET_RT_LITTLE_ENDIAN 0
  463. #define TARGET_RT_BIG_ENDIAN 1
  464. #define TARGET_RT_MAC_CFM 0
  465. #define TARGET_RT_MAC_MACHO 0
  466. #if defined(mc68881)
  467. #define TARGET_RT_MAC_68881 1
  468. #else
  469. #define TARGET_RT_MAC_68881 0
  470. #endif
  471. #define PRAGMA_IMPORT 0
  472. #define PRAGMA_STRUCT_ALIGN 0
  473. #define PRAGMA_ONCE 1
  474. #define PRAGMA_STRUCT_PACK 0
  475. #define PRAGMA_STRUCT_PACKPUSH 0
  476. #define PRAGMA_ENUM_PACK 1
  477. #define PRAGMA_ENUM_ALWAYSINT 0
  478. #define PRAGMA_ENUM_OPTIONS 0
  479. #define FOUR_CHAR_CODE(x) (x)
  480. #define TYPE_EXTENDED 1
  481. #define TYPE_LONGLONG 0
  482. #define TYPE_BOOL 0
  483. #define TYPE_LONGDOUBLE_IS_DOUBLE 1
  484. #define FUNCTION_PASCAL 1
  485. #define FUNCTION_DECLSPEC 0
  486. #define FUNCTION_WIN32CC 0
  487. #define SLASH_INCLUDES_UNSUPPORTED 1
  488. #elif defined(__PPCC__)
  489. /*
  490. PPCC compiler from Apple Computer, Inc. << WARNING: Unsupported Compiler >>
  491. */
  492. #define TARGET_CPU_PPC 1
  493. #define TARGET_CPU_68K 0
  494. #define TARGET_CPU_X86 0
  495. #define TARGET_CPU_MIPS 0
  496. #define TARGET_CPU_SPARC 0
  497. #define TARGET_CPU_ALPHA 0
  498. #define TARGET_OS_MAC 1
  499. #define TARGET_OS_WIN32 0
  500. #define TARGET_OS_UNIX 0
  501. #define TARGET_RT_LITTLE_ENDIAN 0
  502. #define TARGET_RT_BIG_ENDIAN 1
  503. #define TARGET_RT_MAC_CFM 1
  504. #define TARGET_RT_MAC_MACHO 0
  505. #define TARGET_RT_MAC_68881 0
  506. #define PRAGMA_IMPORT 0
  507. #define PRAGMA_STRUCT_ALIGN 1
  508. #define PRAGMA_ONCE 0
  509. #define PRAGMA_STRUCT_PACK 0
  510. #define PRAGMA_STRUCT_PACKPUSH 0
  511. #define PRAGMA_ENUM_PACK 0
  512. #define PRAGMA_ENUM_ALWAYSINT 0
  513. #define PRAGMA_ENUM_OPTIONS 0
  514. #define FOUR_CHAR_CODE(x) (x)
  515. #define TYPE_EXTENDED 0
  516. #define TYPE_LONGLONG 0
  517. #define TYPE_BOOL 0
  518. #define TYPE_LONGDOUBLE_IS_DOUBLE 1
  519. #define FUNCTION_PASCAL 0
  520. #define FUNCTION_DECLSPEC 0
  521. #define FUNCTION_WIN32CC 0
  522. #define SLASH_INCLUDES_UNSUPPORTED 1
  523. #elif defined(applec) && !defined(__SC__)
  524. /*
  525. MPW C compiler from Apple Computer, Inc. << WARNING: Unsupported Compiler >>
  526. */
  527. #define TARGET_CPU_PPC 0
  528. #define TARGET_CPU_68K 1
  529. #define TARGET_CPU_X86 0
  530. #define TARGET_CPU_MIPS 0
  531. #define TARGET_CPU_SPARC 0
  532. #define TARGET_CPU_ALPHA 0
  533. #define TARGET_OS_MAC 1
  534. #define TARGET_OS_WIN32 0
  535. #define TARGET_OS_UNIX 0
  536. #define TARGET_RT_LITTLE_ENDIAN 0
  537. #define TARGET_RT_BIG_ENDIAN 1
  538. #define TARGET_RT_MAC_CFM 0
  539. #define TARGET_RT_MAC_MACHO 0
  540. #if defined(mc68881)
  541. #define TARGET_RT_MAC_68881 1
  542. #else
  543. #define TARGET_RT_MAC_68881 0
  544. #endif
  545. #define PRAGMA_IMPORT 0
  546. #define PRAGMA_STRUCT_ALIGN 0
  547. #define PRAGMA_ONCE 0
  548. #define PRAGMA_STRUCT_PACK 0
  549. #define PRAGMA_STRUCT_PACKPUSH 0
  550. #define PRAGMA_ENUM_PACK 0
  551. #define PRAGMA_ENUM_ALWAYSINT 0
  552. #define PRAGMA_ENUM_OPTIONS 0
  553. /* Note: MPW C 3.2 had a bug where MACRO('xx ') would cause 'xx ' to be misevaluated */
  554. #define FOUR_CHAR_CODE
  555. #define TYPE_EXTENDED 1
  556. #define TYPE_LONGLONG 0
  557. #define TYPE_BOOL 0
  558. #define TYPE_LONGDOUBLE_IS_DOUBLE 0
  559. #define FUNCTION_PASCAL 1
  560. #define FUNCTION_DECLSPEC 0
  561. #define FUNCTION_WIN32CC 0
  562. #define SLASH_INCLUDES_UNSUPPORTED 1
  563. #elif defined(__GNUC__) && (defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__NEXT_CPP__))
  564. /*
  565. gcc based compilers used on OpenStep -> Rhapsody -> Mac OS X
  566. */
  567. #if defined(__ppc__) || defined(powerpc) || defined(ppc)
  568. #define TARGET_CPU_PPC 1
  569. #define TARGET_CPU_68K 0
  570. #define TARGET_CPU_X86 0
  571. #define TARGET_CPU_MIPS 0
  572. #define TARGET_CPU_SPARC 0
  573. #define TARGET_CPU_ALPHA 0
  574. #define TARGET_RT_MAC_68881 0
  575. #define TARGET_RT_LITTLE_ENDIAN 0
  576. #define TARGET_RT_BIG_ENDIAN 1
  577. #ifdef __MACH__
  578. #define TARGET_RT_MAC_MACHO 1
  579. #define TARGET_RT_MAC_CFM 0
  580. #else
  581. #define TARGET_RT_MAC_MACHO 0
  582. #define TARGET_RT_MAC_CFM 1
  583. #endif
  584. #elif defined(m68k)
  585. #define TARGET_CPU_PPC 0
  586. #define TARGET_CPU_68K 1
  587. #define TARGET_CPU_X86 0
  588. #define TARGET_CPU_MIPS 0
  589. #define TARGET_CPU_SPARC 0
  590. #define TARGET_CPU_ALPHA 0
  591. #define TARGET_RT_MAC_CFM 0
  592. #define TARGET_RT_MAC_MACHO 1
  593. #define TARGET_RT_MAC_68881 0
  594. #define TARGET_RT_LITTLE_ENDIAN 0
  595. #define TARGET_RT_BIG_ENDIAN 1
  596. #elif defined(sparc)
  597. #define TARGET_CPU_PPC 0
  598. #define TARGET_CPU_68K 0
  599. #define TARGET_CPU_X86 0
  600. #define TARGET_CPU_MIPS 0
  601. #define TARGET_CPU_SPARC 1
  602. #define TARGET_CPU_ALPHA 0
  603. #define TARGET_RT_MAC_CFM 0
  604. #define TARGET_RT_MAC_MACHO 1
  605. #define TARGET_RT_MAC_68881 0
  606. #define TARGET_RT_LITTLE_ENDIAN 0
  607. #define TARGET_RT_BIG_ENDIAN 1
  608. #elif defined(__i386__) || defined(i386) || defined(intel)
  609. #define TARGET_CPU_PPC 0
  610. #define TARGET_CPU_68K 0
  611. #define TARGET_CPU_X86 1
  612. #define TARGET_CPU_MIPS 0
  613. #define TARGET_CPU_SPARC 0
  614. #define TARGET_CPU_ALPHA 0
  615. #define TARGET_RT_MAC_CFM 0
  616. #define TARGET_RT_MAC_MACHO 1
  617. #define TARGET_RT_MAC_68881 0
  618. #define TARGET_RT_LITTLE_ENDIAN 1
  619. #define TARGET_RT_BIG_ENDIAN 0
  620. #else
  621. #error unrecognized GNU C compiler
  622. #endif
  623. #ifndef TARGET_OS_MAC
  624. #define TARGET_OS_MAC 1
  625. #endif
  626. #ifndef TARGET_OS_WIN32
  627. #define TARGET_OS_WIN32 0
  628. #endif
  629. #ifndef TARGET_OS_UNIX
  630. #define TARGET_OS_UNIX 0
  631. #endif
  632. #define PRAGMA_IMPORT 0
  633. #define PRAGMA_STRUCT_ALIGN 1
  634. #define PRAGMA_ONCE 0
  635. #define PRAGMA_STRUCT_PACK 0
  636. #define PRAGMA_STRUCT_PACKPUSH 0
  637. #define PRAGMA_ENUM_PACK 0
  638. #define PRAGMA_ENUM_ALWAYSINT 0
  639. #define PRAGMA_ENUM_OPTIONS 0
  640. #define FOUR_CHAR_CODE(x) (x)
  641. #define TYPE_LONGDOUBLE_IS_DOUBLE 1
  642. #define TYPE_EXTENDED 0
  643. #if __GNUC__ >= 2
  644. #define TYPE_LONGLONG 1
  645. #else
  646. #define TYPE_LONGLONG 0
  647. #endif
  648. #ifdef __cplusplus
  649. #define TYPE_BOOL 1
  650. #else
  651. #define TYPE_BOOL 0
  652. #endif
  653. #define FUNCTION_PASCAL 0
  654. #define FUNCTION_DECLSPEC 0
  655. #define FUNCTION_WIN32CC 0
  656. #elif defined(__GNUC__) && defined(__linux__)
  657. /*
  658. gcc (egcs, really) for MkLinux. << WARNING: Unsupported Compiler >>
  659. */
  660. #if #cpu(powerpc)
  661. #define TARGET_CPU_PPC 1
  662. #define TARGET_CPU_68K 0
  663. #define TARGET_CPU_X86 0
  664. #define TARGET_CPU_MIPS 0
  665. #define TARGET_CPU_SPARC 0
  666. #define TARGET_CPU_ALPHA 0
  667. #define TARGET_RT_MAC_CFM 1
  668. #define TARGET_RT_MAC_MACHO 0
  669. #define TARGET_RT_MAC_68881 0
  670. #elif #cpu(m68k)
  671. #define TARGET_CPU_PPC 0
  672. #define TARGET_CPU_68K 1
  673. #define TARGET_CPU_X86 0
  674. #define TARGET_CPU_MIPS 0
  675. #define TARGET_CPU_SPARC 0
  676. #define TARGET_CPU_ALPHA 0
  677. #define TARGET_RT_MAC_CFM 0
  678. #define TARGET_RT_MAC_MACHO 0
  679. #define TARGET_RT_MAC_68881 0
  680. #else
  681. #error unsupported GNU C compiler
  682. #endif
  683. #if #system(macos)
  684. #define TARGET_OS_MAC 1
  685. #define TARGET_OS_WIN32 0
  686. #define TARGET_OS_UNIX 0
  687. #elif #system(unix)
  688. #define TARGET_OS_MAC 0
  689. #define TARGET_OS_WIN32 0
  690. #define TARGET_OS_UNIX 1
  691. #else
  692. #error unsupported GNU C compiler
  693. #endif
  694. #define TARGET_RT_LITTLE_ENDIAN 0
  695. #define TARGET_RT_BIG_ENDIAN 1
  696. #define PRAGMA_IMPORT 0
  697. #define PRAGMA_STRUCT_ALIGN 0
  698. #define PRAGMA_ONCE 0
  699. #define PRAGMA_STRUCT_PACK 1
  700. #define PRAGMA_STRUCT_PACKPUSH 0
  701. #define PRAGMA_ENUM_PACK 0
  702. #define PRAGMA_ENUM_ALWAYSINT 0
  703. #define PRAGMA_ENUM_OPTIONS 0
  704. #define FOUR_CHAR_CODE(x) (x)
  705. #define TYPE_LONGDOUBLE_IS_DOUBLE 1
  706. #define TYPE_EXTENDED 0
  707. #ifdef _LONG_LONG
  708. #define TYPE_LONGLONG 1
  709. #else
  710. #define TYPE_LONGLONG 0
  711. #endif
  712. #define TYPE_BOOL 0
  713. #define FUNCTION_PASCAL 0
  714. #define FUNCTION_DECLSPEC 0
  715. #define FUNCTION_WIN32CC 0
  716. #elif defined(__GNUC__) && defined(__MINGW32__)
  717. /*
  718. Mingw gnu gcc/egcs compiler for Win32 systems (http://www.mingw.org).
  719. */
  720. #define TARGET_CPU_PPC 0
  721. #define TARGET_CPU_68K 0
  722. #define TARGET_CPU_X86 1
  723. #define TARGET_CPU_MIPS 0
  724. #define TARGET_CPU_SPARC 0
  725. #define TARGET_CPU_ALPHA 0
  726. #define TARGET_RT_MAC_CFM 0
  727. #define TARGET_RT_MAC_MACHO 0
  728. #define TARGET_RT_MAC_68881 0
  729. #define TARGET_OS_MAC 0
  730. #define TARGET_OS_WIN32 1
  731. #define TARGET_OS_UNIX 0
  732. #define TARGET_RT_LITTLE_ENDIAN 1
  733. #define TARGET_RT_BIG_ENDIAN 0
  734. #define __COREAUDIO_USE_FLAT_INCLUDES__ 1
  735. #define PRAGMA_IMPORT 0
  736. #define PRAGMA_STRUCT_ALIGN 0
  737. #define PRAGMA_ONCE 0
  738. #define PRAGMA_STRUCT_PACK 1
  739. #define PRAGMA_STRUCT_PACKPUSH 0
  740. #define PRAGMA_ENUM_PACK 0
  741. #define PRAGMA_ENUM_ALWAYSINT 0
  742. #define PRAGMA_ENUM_OPTIONS 0
  743. #define FOUR_CHAR_CODE(x) (x)
  744. #define TYPE_EXTENDED 0
  745. #define TYPE_LONGDOUBLE_IS_DOUBLE 1
  746. #define TYPE_LONGLONG 1
  747. #define TYPE_BOOL 1
  748. #define FUNCTION_PASCAL 0
  749. #define FUNCTION_DECLSPEC 0
  750. #define FUNCTION_WIN32CC 0
  751. #elif defined(__GNUC__)
  752. /*
  753. gC for MPW from Free Software Foundation, Inc.
  754. */
  755. #if #cpu(powerpc)
  756. #define TARGET_CPU_PPC 1
  757. #define TARGET_CPU_68K 0
  758. #define TARGET_CPU_X86 0
  759. #define TARGET_CPU_MIPS 0
  760. #define TARGET_CPU_SPARC 0
  761. #define TARGET_CPU_ALPHA 0
  762. #define TARGET_RT_MAC_CFM 1
  763. #define TARGET_RT_MAC_MACHO 0
  764. #define TARGET_RT_MAC_68881 0
  765. #elif #cpu(m68k)
  766. #define TARGET_CPU_PPC 0
  767. #define TARGET_CPU_68K 1
  768. #define TARGET_CPU_X86 0
  769. #define TARGET_CPU_MIPS 0
  770. #define TARGET_CPU_SPARC 0
  771. #define TARGET_CPU_ALPHA 0
  772. #define TARGET_RT_MAC_CFM 0
  773. #define TARGET_RT_MAC_MACHO 0
  774. #define TARGET_RT_MAC_68881 0
  775. #else
  776. #error unsupported GNU C compiler
  777. #endif
  778. #if #system(macos)
  779. #define TARGET_OS_MAC 1
  780. #define TARGET_OS_WIN32 0
  781. #define TARGET_OS_UNIX 0
  782. #elif #system(unix)
  783. #define TARGET_OS_MAC 0
  784. #define TARGET_OS_WIN32 0
  785. #define TARGET_OS_UNIX 1
  786. #else
  787. #error unsupported GNU C compiler
  788. #endif
  789. #define TARGET_RT_LITTLE_ENDIAN 0
  790. #define TARGET_RT_BIG_ENDIAN 1
  791. #define PRAGMA_IMPORT 0
  792. #define PRAGMA_STRUCT_ALIGN 1
  793. #define PRAGMA_ONCE 0
  794. #define PRAGMA_STRUCT_PACK 0
  795. #define PRAGMA_STRUCT_PACKPUSH 0
  796. #define PRAGMA_ENUM_PACK 0
  797. #define PRAGMA_ENUM_ALWAYSINT 0
  798. #define PRAGMA_ENUM_OPTIONS 0
  799. #define FOUR_CHAR_CODE(x) (x)
  800. #define TYPE_LONGDOUBLE_IS_DOUBLE 1
  801. #define TYPE_EXTENDED 0
  802. #ifdef _LONG_LONG
  803. #define TYPE_LONGLONG 1
  804. #else
  805. #define TYPE_LONGLONG 0
  806. #endif
  807. #define TYPE_BOOL 0
  808. #define FUNCTION_PASCAL 0
  809. #define FUNCTION_DECLSPEC 0
  810. #define FUNCTION_WIN32CC 0
  811. #elif defined(__xlc) || defined(__xlC) || defined(__xlC__) || defined(__XLC121__)
  812. /*
  813. xlc and xlC on RS/6000 from IBM, Inc.
  814. */
  815. #define TARGET_CPU_PPC 1
  816. #define TARGET_CPU_68K 0
  817. #define TARGET_CPU_X86 0
  818. #define TARGET_CPU_MIPS 0
  819. #define TARGET_CPU_SPARC 0
  820. #define TARGET_CPU_ALPHA 0
  821. #if defined(_AIX)
  822. #define TARGET_OS_MAC 0
  823. #define TARGET_OS_UNIX 1
  824. #else
  825. #define TARGET_OS_MAC 1
  826. #define TARGET_OS_UNIX 0
  827. #endif
  828. #define TARGET_OS_WIN32 0
  829. #define TARGET_RT_LITTLE_ENDIAN 0
  830. #define TARGET_RT_BIG_ENDIAN 1
  831. #define TARGET_RT_MAC_CFM 1
  832. #define TARGET_RT_MAC_MACHO 0
  833. #define TARGET_RT_MAC_68881 0
  834. #define PRAGMA_IMPORT 0
  835. #define PRAGMA_STRUCT_ALIGN 1
  836. #define PRAGMA_ONCE 0
  837. #define PRAGMA_STRUCT_PACK 0
  838. #define PRAGMA_STRUCT_PACKPUSH 0
  839. #define PRAGMA_ENUM_PACK 0
  840. #define PRAGMA_ENUM_ALWAYSINT 0
  841. #define PRAGMA_ENUM_OPTIONS 1
  842. #define FOUR_CHAR_CODE(x) (x)
  843. #define TYPE_LONGDOUBLE_IS_DOUBLE 0
  844. #define TYPE_EXTENDED 0
  845. #ifdef _LONG_LONG
  846. #define TYPE_LONGLONG 1
  847. #else
  848. #define TYPE_LONGLONG 0
  849. #endif
  850. #define TYPE_BOOL 0
  851. #define FUNCTION_PASCAL 0
  852. #define FUNCTION_DECLSPEC 0
  853. #define FUNCTION_WIN32CC 0
  854. #elif defined(_MSC_VER) && !defined(__MWERKS__)
  855. /*
  856. Visual Studio C/C++ from Microsoft, Inc.
  857. */
  858. #if defined(_M_M68K) /* Visual C++ with Macintosh 68K target */
  859. #define TARGET_CPU_PPC 0
  860. #define TARGET_CPU_68K 1
  861. #define TARGET_CPU_X86 0
  862. #define TARGET_CPU_MIPS 0
  863. #define TARGET_CPU_SPARC 0
  864. #define TARGET_CPU_ALPHA 0
  865. #define TARGET_OS_MAC 1
  866. #define TARGET_OS_WIN32 0
  867. #define TARGET_OS_UNIX 0
  868. #define TARGET_RT_LITTLE_ENDIAN 0
  869. #define TARGET_RT_BIG_ENDIAN 1
  870. #define TARGET_RT_MAC_CFM 0
  871. #define TARGET_RT_MAC_MACHO 0
  872. #define TARGET_RT_MAC_68881 0
  873. #define PRAGMA_IMPORT 0
  874. #define PRAGMA_STRUCT_ALIGN 1
  875. #define PRAGMA_ONCE 0
  876. #define PRAGMA_STRUCT_PACK 1
  877. #define PRAGMA_STRUCT_PACKPUSH 1
  878. #define PRAGMA_ENUM_PACK 0
  879. #define PRAGMA_ENUM_ALWAYSINT 0
  880. #define PRAGMA_ENUM_OPTIONS 0
  881. #define FOUR_CHAR_CODE(x) (x)
  882. #define TYPE_LONGDOUBLE_IS_DOUBLE 1
  883. #define TYPE_EXTENDED 0
  884. #define TYPE_LONGLONG 0
  885. #define TYPE_BOOL 0
  886. #define FUNCTION_PASCAL 1
  887. #define FUNCTION_DECLSPEC 0
  888. #define FUNCTION_WIN32CC 0
  889. #elif defined(_M_MPPC) /* Visual C++ with Macintosh PowerPC target */
  890. #define TARGET_CPU_PPC 1
  891. #define TARGET_CPU_68K 0
  892. #define TARGET_CPU_X86 0
  893. #define TARGET_CPU_MIPS 0
  894. #define TARGET_CPU_SPARC 0
  895. #define TARGET_CPU_ALPHA 0
  896. #define TARGET_OS_MAC 1
  897. #define TARGET_OS_WIN32 0
  898. #define TARGET_OS_UNIX 0
  899. #define TARGET_RT_LITTLE_ENDIAN 0
  900. #define TARGET_RT_BIG_ENDIAN 1
  901. #define TARGET_RT_MAC_CFM 1
  902. #define TARGET_RT_MAC_MACHO 0
  903. #define TARGET_RT_MAC_68881 0
  904. #define PRAGMA_IMPORT 0
  905. #define PRAGMA_STRUCT_ALIGN 1
  906. #define PRAGMA_ONCE 0
  907. #define PRAGMA_STRUCT_PACK 1
  908. #define PRAGMA_STRUCT_PACKPUSH 1
  909. #define PRAGMA_ENUM_PACK 0
  910. #define PRAGMA_ENUM_ALWAYSINT 0
  911. #define PRAGMA_ENUM_OPTIONS 0
  912. #define FOUR_CHAR_CODE(x) (x)
  913. #define TYPE_LONGDOUBLE_IS_DOUBLE 1
  914. #define TYPE_EXTENDED 0
  915. #define TYPE_LONGLONG 0
  916. #define TYPE_BOOL 0
  917. #define FUNCTION_PASCAL 0
  918. #define FUNCTION_DECLSPEC 0
  919. #define FUNCTION_WIN32CC 0
  920. #elif defined(_M_IX86) /* Visual Studio with Intel x86 target */
  921. #define TARGET_CPU_PPC 0
  922. #define TARGET_CPU_68K 0
  923. #define TARGET_CPU_X86 1
  924. #define TARGET_CPU_MIPS 0
  925. #define TARGET_CPU_SPARC 0
  926. #define TARGET_CPU_ALPHA 0
  927. #define TARGET_OS_MAC 0
  928. #define TARGET_OS_WIN32 1
  929. #define TARGET_OS_UNIX 0
  930. #define TARGET_RT_LITTLE_ENDIAN 1
  931. #define TARGET_RT_BIG_ENDIAN 0
  932. #define __COREAUDIO_USE_FLAT_INCLUDES__ 1
  933. #define PRAGMA_IMPORT 0
  934. #define PRAGMA_STRUCT_ALIGN 0
  935. #define PRAGMA_ONCE 1
  936. #define PRAGMA_STRUCT_PACK 1
  937. #define PRAGMA_STRUCT_PACKPUSH 1
  938. #define PRAGMA_ENUM_PACK 0
  939. #define PRAGMA_ENUM_ALWAYSINT 0
  940. #define PRAGMA_ENUM_OPTIONS 0
  941. #define FOUR_CHAR_CODE(x) (x)
  942. #define TYPE_LONGDOUBLE_IS_DOUBLE 1
  943. #define TYPE_EXTENDED 0
  944. #define TYPE_LONGLONG 1 /* note: uses __int64 instead of long long */
  945. #define LONGLONG_TYPENAME __int64
  946. #define LONGLONG_SIGNED_MAX (9223372036854775807i64)
  947. #define LONGLONG_SIGNED_MIN (-9223372036854775807i64 - 1)
  948. #define LONGLONG_UNSIGNED_MAX (0xffffffffffffffffui64)
  949. #if defined(__cplusplus) && (_MSC_VER >= 1100)
  950. #define TYPE_BOOL 1
  951. #else
  952. #define TYPE_BOOL 0
  953. #endif
  954. #define FUNCTION_PASCAL 0
  955. #ifndef FUNCTION_DECLSPEC /* allow use of __declspec(dllimport) to be enabled */
  956. #define FUNCTION_DECLSPEC 0 /* QuickTime for Windows cannot use dllimport */
  957. #endif
  958. #ifndef FUNCTION_WIN32CC /* allow calling convention to be overriddden */
  959. #define FUNCTION_WIN32CC 1
  960. #endif
  961. /* Warning: This macros away the pascal word in source code. */
  962. /* Very useful for code that needs to compile on Mac 68k and Windows */
  963. /* but can silently change code */
  964. #undef pascal
  965. #define pascal
  966. #elif defined(_M_ALPHA) /* Visual C++ with Dec Alpha target */
  967. #define TARGET_CPU_PPC 0
  968. #define TARGET_CPU_68K 0
  969. #define TARGET_CPU_X86 0
  970. #define TARGET_CPU_MIPS 0
  971. #define TARGET_CPU_SPARC 0
  972. #define TARGET_CPU_ALPHA 1
  973. #define TARGET_OS_MAC 0
  974. #define TARGET_OS_WIN32 1
  975. #define TARGET_OS_UNIX 0
  976. #define TARGET_RT_LITTLE_ENDIAN 1
  977. #define TARGET_RT_BIG_ENDIAN 0
  978. #define __COREAUDIO_USE_FLAT_INCLUDES__ 1
  979. #define PRAGMA_IMPORT 0
  980. #define PRAGMA_STRUCT_ALIGN 0
  981. #define PRAGMA_ONCE 0
  982. #define PRAGMA_STRUCT_PACK 1
  983. #define PRAGMA_STRUCT_PACKPUSH 1
  984. #define PRAGMA_ENUM_PACK 0
  985. #define PRAGMA_ENUM_ALWAYSINT 0
  986. #define PRAGMA_ENUM_OPTIONS 0
  987. #define FOUR_CHAR_CODE(x) (((unsigned long) ((x) & 0x000000FF)) << 24) \
  988. | (((unsigned long) ((x) & 0x0000FF00)) << 8) \
  989. | (((unsigned long) ((x) & 0x00FF0000)) >> 8) \
  990. | (((unsigned long) ((x) & 0xFF000000)) >> 24)
  991. #define TYPE_EXTENDED 0
  992. #define TYPE_LONGDOUBLE_IS_DOUBLE 1
  993. #define TYPE_LONGLONG 0
  994. #define TYPE_BOOL 0
  995. #define FUNCTION_PASCAL 0
  996. #define FUNCTION_DECLSPEC 0
  997. #define FUNCTION_WIN32CC 0
  998. #elif defined(_M_PPC) /* Visual C++ for Windows NT on PowerPC target */
  999. #define TARGET_CPU_PPC 1
  1000. #define TARGET_CPU_68K 0
  1001. #define TARGET_CPU_X86 0
  1002. #define TARGET_CPU_MIPS 0
  1003. #define TARGET_CPU_SPARC 0
  1004. #define TARGET_CPU_ALPHA 0
  1005. #define TARGET_OS_MAC 0
  1006. #define TARGET_OS_WIN32 1
  1007. #define TARGET_OS_UNIX 0
  1008. #define TARGET_RT_LITTLE_ENDIAN 1
  1009. #define TARGET_RT_BIG_ENDIAN 0
  1010. #define __COREAUDIO_USE_FLAT_INCLUDES__ 1
  1011. #define PRAGMA_IMPORT 0
  1012. #define PRAGMA_STRUCT_ALIGN 0
  1013. #define PRAGMA_ONCE 0
  1014. #define PRAGMA_STRUCT_PACK 1
  1015. #define PRAGMA_STRUCT_PACKPUSH 1
  1016. #define PRAGMA_ENUM_PACK 0
  1017. #define PRAGMA_ENUM_ALWAYSINT 0
  1018. #define PRAGMA_ENUM_OPTIONS 0
  1019. #define FOUR_CHAR_CODE(x) (((unsigned long) ((x) & 0x000000FF)) << 24) \
  1020. | (((unsigned long) ((x) & 0x0000FF00)) << 8) \
  1021. | (((unsigned long) ((x) & 0x00FF0000)) >> 8) \
  1022. | (((unsigned long) ((x) & 0xFF000000)) >> 24)
  1023. #define TYPE_EXTENDED 0
  1024. #define TYPE_LONGLONG 0
  1025. #define TYPE_BOOL 0
  1026. #define FUNCTION_PASCAL 0
  1027. #define FUNCTION_DECLSPEC 0
  1028. #define FUNCTION_WIN32CC 0
  1029. #elif defined(_M_MRX000) /* Visual C++ for Windows NT on MIPS target */
  1030. #define TARGET_CPU_PPC 0
  1031. #define TARGET_CPU_68K 0
  1032. #define TARGET_CPU_X86 0
  1033. #define TARGET_CPU_MIPS 1
  1034. #define TARGET_CPU_SPARC 0
  1035. #define TARGET_CPU_ALPHA 0
  1036. #define TARGET_OS_MAC 0
  1037. #define TARGET_OS_WIN32 1
  1038. #define TARGET_OS_UNIX 0
  1039. #define TARGET_RT_LITTLE_ENDIAN 1
  1040. #define TARGET_RT_BIG_ENDIAN 0
  1041. #define __COREAUDIO_USE_FLAT_INCLUDES__ 1
  1042. #define PRAGMA_IMPORT 0
  1043. #define PRAGMA_STRUCT_ALIGN 0
  1044. #define PRAGMA_ONCE 0
  1045. #define PRAGMA_STRUCT_PACK 1
  1046. #define PRAGMA_STRUCT_PACKPUSH 1
  1047. #define PRAGMA_ENUM_PACK 0
  1048. #define PRAGMA_ENUM_ALWAYSINT 0
  1049. #define PRAGMA_ENUM_OPTIONS 0
  1050. #define FOUR_CHAR_CODE(x) (((unsigned long) ((x) & 0x000000FF)) << 24) \
  1051. | (((unsigned long) ((x) & 0x0000FF00)) << 8) \
  1052. | (((unsigned long) ((x) & 0x00FF0000)) >> 8) \
  1053. | (((unsigned long) ((x) & 0xFF000000)) >> 24)
  1054. #define TYPE_EXTENDED 0
  1055. #define TYPE_LONGDOUBLE_IS_DOUBLE 1
  1056. #define TYPE_LONGLONG 0
  1057. #define TYPE_BOOL 0
  1058. #define FUNCTION_PASCAL 0
  1059. #define FUNCTION_DECLSPEC 0
  1060. #define FUNCTION_WIN32CC 0
  1061. #endif
  1062. #elif defined(__MOTO__)
  1063. /*
  1064. mcc from Motorola, Inc.
  1065. */
  1066. #define TARGET_CPU_PPC 1
  1067. #define TARGET_CPU_68K 0
  1068. #define TARGET_CPU_X86 0
  1069. #define TARGET_CPU_MIPS 0
  1070. #define TARGET_CPU_SPARC 0
  1071. #define TARGET_CPU_ALPHA 0
  1072. #define TARGET_OS_MAC 1
  1073. #define TARGET_OS_WIN32 0
  1074. #define TARGET_OS_UNIX 0
  1075. #define TARGET_RT_LITTLE_ENDIAN 0
  1076. #define TARGET_RT_BIG_ENDIAN 1
  1077. #define TARGET_RT_MAC_CFM 1
  1078. #define TARGET_RT_MAC_MACHO 0
  1079. #define TARGET_RT_MAC_68881 0
  1080. #define PRAGMA_IMPORT 0 /* how is this detected ?? */
  1081. #define PRAGMA_STRUCT_ALIGN 1
  1082. #if __MOTO__ >= 40702 /* MCC version 4.7.2 */
  1083. #define PRAGMA_ONCE 1
  1084. #else
  1085. #define PRAGMA_ONCE 0
  1086. #endif
  1087. #define PRAGMA_STRUCT_PACK 0
  1088. #define PRAGMA_STRUCT_PACKPUSH 0
  1089. #define PRAGMA_ENUM_PACK 0
  1090. #define PRAGMA_ENUM_ALWAYSINT 0
  1091. #define PRAGMA_ENUM_OPTIONS 0
  1092. #define FOUR_CHAR_CODE(x) (x)
  1093. #define TYPE_LONGLONG 0 /* how is this detected ?? */
  1094. #ifdef _BOOL
  1095. #define TYPE_BOOL 1
  1096. #else
  1097. #define TYPE_BOOL 0
  1098. #endif
  1099. #define TYPE_EXTENDED 0
  1100. #define TYPE_LONGDOUBLE_IS_DOUBLE 1
  1101. #define FUNCTION_PASCAL 0
  1102. #define FUNCTION_DECLSPEC 0
  1103. #define FUNCTION_WIN32CC 0
  1104. #elif defined(_MIPS_ISA)
  1105. /*
  1106. MIPSpro compiler from Silicon Graphics Inc.
  1107. */
  1108. #define TARGET_CPU_PPC 0
  1109. #define TARGET_CPU_68K 0
  1110. #define TARGET_CPU_X86 0
  1111. #define TARGET_CPU_MIPS 1
  1112. #define TARGET_CPU_SPARC 0
  1113. #define TARGET_CPU_ALPHA 0
  1114. #define TARGET_OS_MAC 0
  1115. #define TARGET_OS_WIN32 0
  1116. #define TARGET_OS_UNIX 1
  1117. #define TARGET_RT_LITTLE_ENDIAN 0
  1118. #define TARGET_RT_BIG_ENDIAN 1
  1119. #define PRAGMA_IMPORT 0
  1120. #define PRAGMA_STRUCT_ALIGN 0
  1121. #define PRAGMA_ONCE 0
  1122. #define PRAGMA_STRUCT_PACK 1
  1123. #define PRAGMA_STRUCT_PACKPUSH 0
  1124. #define PRAGMA_ENUM_PACK 0
  1125. #define PRAGMA_ENUM_ALWAYSINT 0
  1126. #define PRAGMA_ENUM_OPTIONS 0
  1127. #define FOUR_CHAR_CODE(x) (x)
  1128. #define TYPE_LONGDOUBLE_IS_DOUBLE 1
  1129. #define TYPE_EXTENDED 0
  1130. #define TYPE_LONGLONG 0
  1131. #define TYPE_BOOL 0
  1132. #define FUNCTION_PASCAL 0
  1133. #define FUNCTION_DECLSPEC 0
  1134. #define FUNCTION_WIN32CC 0
  1135. #elif defined(__sparc)
  1136. /*
  1137. SPARCompiler compiler from Sun Microsystems Inc.
  1138. */
  1139. #define TARGET_CPU_PPC 0
  1140. #define TARGET_CPU_68K 0
  1141. #define TARGET_CPU_X86 0
  1142. #define TARGET_CPU_MIPS 0
  1143. #define TARGET_CPU_SPARC 1
  1144. #define TARGET_CPU_ALPHA 0
  1145. #define TARGET_OS_MAC 0
  1146. #define TARGET_OS_WIN32 0
  1147. #define TARGET_OS_UNIX 1
  1148. #define TARGET_RT_LITTLE_ENDIAN 0
  1149. #define TARGET_RT_BIG_ENDIAN 1
  1150. #define PRAGMA_IMPORT 0
  1151. #define PRAGMA_STRUCT_ALIGN 0
  1152. #define PRAGMA_ONCE 0
  1153. #define PRAGMA_STRUCT_PACK 1
  1154. #define PRAGMA_STRUCT_PACKPUSH 0
  1155. #define PRAGMA_ENUM_PACK 0
  1156. #define PRAGMA_ENUM_ALWAYSINT 0
  1157. #define PRAGMA_ENUM_OPTIONS 0
  1158. #define FOUR_CHAR_CODE(x) (((unsigned long) ((x) & 0x000000FF)) << 24) \
  1159. | (((unsigned long) ((x) & 0x0000FF00)) << 8) \
  1160. | (((unsigned long) ((x) & 0x00FF0000)) >> 8) \
  1161. | (((unsigned long) ((x) & 0xFF000000)) >> 24)
  1162. #define TYPE_LONGDOUBLE_IS_DOUBLE 1
  1163. #define TYPE_EXTENDED 0
  1164. #define TYPE_LONGLONG 0
  1165. #define TYPE_BOOL 0
  1166. #define FUNCTION_PASCAL 0
  1167. #define FUNCTION_DECLSPEC 0
  1168. #define FUNCTION_WIN32CC 0
  1169. #else
  1170. /*
  1171. Unknown compiler, perhaps set up from the command line (e.g. -d TARGET_CPU_MIPS , etc.)
  1172. */
  1173. #if defined(TARGET_CPU_PPC) && TARGET_CPU_PPC
  1174. #define TARGET_CPU_68K 0
  1175. #define TARGET_CPU_X86 0
  1176. #define TARGET_CPU_MIPS 0
  1177. #define TARGET_CPU_SPARC 0
  1178. #define TARGET_CPU_ALPHA 0
  1179. #elif defined(TARGET_CPU_68K) && TARGET_CPU_68K
  1180. #define TARGET_CPU_PPC 0
  1181. #define TARGET_CPU_X86 0
  1182. #define TARGET_CPU_MIPS 0
  1183. #define TARGET_CPU_SPARC 0
  1184. #define TARGET_CPU_ALPHA 0
  1185. #elif defined(TARGET_CPU_X86) && TARGET_CPU_X86
  1186. #define TARGET_CPU_PPC 0
  1187. #define TARGET_CPU_68K 0
  1188. #define TARGET_CPU_MIPS 0
  1189. #define TARGET_CPU_SPARC 0
  1190. #define TARGET_CPU_ALPHA 0
  1191. #elif defined(TARGET_CPU_MIPS) && TARGET_CPU_MIPS
  1192. #define TARGET_CPU_PPC 0
  1193. #define TARGET_CPU_68K 0
  1194. #define TARGET_CPU_X86 0
  1195. #define TARGET_CPU_SPARC 0
  1196. #define TARGET_CPU_ALPHA 0
  1197. #elif defined(TARGET_CPU_SPARC) && TARGET_CPU_SPARC
  1198. #define TARGET_CPU_PPC 0
  1199. #define TARGET_CPU_68K 0
  1200. #define TARGET_CPU_X86 0
  1201. #define TARGET_CPU_MIPS 0
  1202. #define TARGET_CPU_ALPHA 0
  1203. #elif defined(TARGET_CPU_ALPHA) && TARGET_CPU_ALPHA
  1204. #define TARGET_CPU_PPC 0
  1205. #define TARGET_CPU_68K 0
  1206. #define TARGET_CPU_X86 0
  1207. #define TARGET_CPU_MIPS 0
  1208. #define TARGET_CPU_SPARC 0
  1209. #else
  1210. /*
  1211. NOTE: If your compiler errors out here then support for your compiler
  1212. has not yet been added to ConditionalMacros.h.
  1213. ConditionalMacros.h is designed to be plug-and-play. It auto detects
  1214. which compiler is being run and configures the TARGET_ conditionals
  1215. appropriately.
  1216. The short term work around is to set the TARGET_CPU_ and TARGET_OS_
  1217. on the command line to the compiler (e.g. d TARGET_CPU_MIPS -d TARGET_OS_UNIX)
  1218. The long term solution is to add a new case to this file which
  1219. auto detects your compiler and sets up the TARGET_ conditionals.
  1220. If you do this, send the changes you made to devsupport@apple.com
  1221. to get it integrated into the next release of ConditionalMacros.h.
  1222. */
  1223. #error ConditionalMacros.h: unknown compiler (see comment above)
  1224. #define TARGET_CPU_PPC 0
  1225. #define TARGET_CPU_68K 0
  1226. #define TARGET_CPU_X86 0
  1227. #define TARGET_CPU_MIPS 0
  1228. #define TARGET_CPU_SPARC 0
  1229. #define TARGET_CPU_ALPHA 0
  1230. #endif
  1231. #if defined(TARGET_OS_MAC) && TARGET_OS_MAC
  1232. #define TARGET_OS_WIN32 0
  1233. #define TARGET_OS_UNIX 0
  1234. #elif defined(TARGET_OS_WIN32) && TARGET_OS_WIN32
  1235. #define TARGET_OS_MAC 0
  1236. #define TARGET_OS_UNIX 0
  1237. #elif defined(TARGET_OS_UNIX) && TARGET_OS_UNIX
  1238. #define TARGET_OS_MAC 0
  1239. #define TARGET_OS_WIN32 0
  1240. #elif TARGET_CPU_PPC || TARGET_CPU_68K
  1241. #define TARGET_OS_MAC 1
  1242. #define TARGET_OS_WIN32 0
  1243. #define TARGET_OS_UNIX 0
  1244. #else
  1245. #error ConditionalMacros.h: unknown target OS (see comment above)
  1246. #endif
  1247. #if !defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
  1248. #if TARGET_OS_MAC
  1249. #define TARGET_RT_LITTLE_ENDIAN 0
  1250. #define TARGET_RT_BIG_ENDIAN 1
  1251. #elif TARGET_OS_WIN32
  1252. #define TARGET_RT_LITTLE_ENDIAN 1
  1253. #define TARGET_RT_BIG_ENDIAN 0
  1254. #endif
  1255. #endif
  1256. #if defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
  1257. #define TARGET_RT_LITTLE_ENDIAN !TARGET_RT_BIG_ENDIAN
  1258. #elif !defined(TARGET_RT_BIG_ENDIAN) && defined(TARGET_RT_LITTLE_ENDIAN)
  1259. #define TARGET_RT_BIG_ENDIAN !TARGET_RT_LITTLE_ENDIAN
  1260. #endif
  1261. #if !defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
  1262. #error unknown endianess of target processor
  1263. #endif
  1264. #if TARGET_OS_MAC
  1265. #ifndef TARGET_RT_MAC_CFM
  1266. #define TARGET_RT_MAC_CFM TARGET_CPU_PPC
  1267. #endif
  1268. #ifndef TARGET_RT_MAC_68881
  1269. #define TARGET_RT_MAC_68881 0
  1270. #endif
  1271. #ifndef TARGET_RT_MAC_MACHO
  1272. #define TARGET_RT_MAC_MACHO !TARGET_RT_MAC_CFM
  1273. #endif
  1274. #endif
  1275. #ifndef PRAGMA_IMPORT
  1276. #define PRAGMA_IMPORT 0
  1277. #endif
  1278. #ifndef PRAGMA_STRUCT_ALIGN
  1279. #define PRAGMA_STRUCT_ALIGN 0
  1280. #endif
  1281. #ifndef PRAGMA_ONCE
  1282. #define PRAGMA_ONCE 0
  1283. #endif
  1284. #ifndef PRAGMA_STRUCT_PACK
  1285. #define PRAGMA_STRUCT_PACK 0
  1286. #endif
  1287. #ifndef PRAGMA_STRUCT_PACKPUSH
  1288. #define PRAGMA_STRUCT_PACKPUSH 0
  1289. #endif
  1290. #ifndef PRAGMA_ENUM_PACK
  1291. #define PRAGMA_ENUM_PACK 0
  1292. #endif
  1293. #ifndef PRAGMA_ENUM_ALWAYSINT
  1294. #define PRAGMA_ENUM_ALWAYSINT 0
  1295. #endif
  1296. #ifndef PRAGMA_ENUM_OPTIONS
  1297. #define PRAGMA_ENUM_OPTIONS 0
  1298. #endif
  1299. #ifndef FOUR_CHAR_CODE
  1300. #define FOUR_CHAR_CODE(x) (x)
  1301. #endif
  1302. #ifndef TYPE_LONGDOUBLE_IS_DOUBLE
  1303. #define TYPE_LONGDOUBLE_IS_DOUBLE 1
  1304. #endif
  1305. #ifndef TYPE_EXTENDED
  1306. #define TYPE_EXTENDED 0
  1307. #endif
  1308. #ifndef TYPE_LONGLONG
  1309. #define TYPE_LONGLONG 0
  1310. #endif
  1311. #ifndef TYPE_BOOL
  1312. #define TYPE_BOOL 0
  1313. #endif
  1314. #ifndef FUNCTION_PASCAL
  1315. #define FUNCTION_PASCAL 0
  1316. #endif
  1317. #ifndef FUNCTION_DECLSPEC
  1318. #define FUNCTION_DECLSPEC 0
  1319. #endif
  1320. #ifndef FUNCTION_WIN32CC
  1321. #define FUNCTION_WIN32CC 0
  1322. #endif
  1323. #endif
  1324. /****************************************************************************************************
  1325. Under MacOS, the classic 68k runtime has two calling conventions: pascal or C
  1326. Under Win32, there are two calling conventions: __cdecl or __stdcall
  1327. Headers and implementation files can use the following macros to make their
  1328. source more portable by hiding the calling convention details:
  1329. EXTERN_API*
  1330. These macros are used to specify the calling convention on a function prototype.
  1331. EXTERN_API - Classic 68k: pascal, Win32: __cdecl
  1332. EXTERN_API_C - Classic 68k: C, Win32: __cdecl
  1333. EXTERN_API_STDCALL - Classic 68k: pascal, Win32: __stdcall
  1334. EXTERN_API_C_STDCALL - Classic 68k: C, Win32: __stdcall
  1335. DEFINE_API*
  1336. These macros are used to specify the calling convention on a function definition.
  1337. DEFINE_API - Classic 68k: pascal, Win32: __cdecl
  1338. DEFINE_API_C - Classic 68k: C, Win32: __cdecl
  1339. DEFINE_API_STDCALL - Classic 68k: pascal, Win32: __stdcall
  1340. DEFINE_API_C_STDCALL - Classic 68k: C, Win32: __stdcall
  1341. CALLBACK_API*
  1342. These macros are used to specify the calling convention of a function pointer.
  1343. CALLBACK_API - Classic 68k: pascal, Win32: __stdcall
  1344. CALLBACK_API_C - Classic 68k: C, Win32: __stdcall
  1345. CALLBACK_API_STDCALL - Classic 68k: pascal, Win32: __cdecl
  1346. CALLBACK_API_C_STDCALL - Classic 68k: C, Win32: __cdecl
  1347. ****************************************************************************************************/
  1348. #if FUNCTION_PASCAL && !FUNCTION_DECLSPEC && !FUNCTION_WIN32CC
  1349. /* compiler supports pascal keyword only */
  1350. #define EXTERN_API(_type) extern pascal _type
  1351. #define EXTERN_API_C(_type) extern _type
  1352. #define EXTERN_API_STDCALL(_type) extern pascal _type
  1353. #define EXTERN_API_C_STDCALL(_type) extern _type
  1354. #define DEFINE_API(_type) pascal _type
  1355. #define DEFINE_API_C(_type) _type
  1356. #define DEFINE_API_STDCALL(_type) pascal _type
  1357. #define DEFINE_API_C_STDCALL(_type) _type
  1358. #define CALLBACK_API(_type, _name) pascal _type (*_name)
  1359. #define CALLBACK_API_C(_type, _name) _type (*_name)
  1360. #define CALLBACK_API_STDCALL(_type, _name) pascal _type (*_name)
  1361. #define CALLBACK_API_C_STDCALL(_type, _name) _type (*_name)
  1362. #elif FUNCTION_PASCAL && FUNCTION_DECLSPEC && !FUNCTION_WIN32CC
  1363. /* compiler supports pascal and __declspec() */
  1364. #define EXTERN_API(_type) extern pascal __declspec(dllimport) _type
  1365. #define EXTERN_API_C(_type) extern __declspec(dllimport) _type
  1366. #define EXTERN_API_STDCALL(_type) extern pascal __declspec(dllimport) _type
  1367. #define EXTERN_API_C_STDCALL(_type) extern __declspec(dllimport) _type
  1368. #define DEFINE_API(_type) pascal __declspec(dllexport) _type
  1369. #define DEFINE_API_C(_type) __declspec(dllexport) _type
  1370. #define DEFINE_API_STDCALL(_type) pascal __declspec(dllexport) _type
  1371. #define DEFINE_API_C_STDCALL(_type) __declspec(dllexport) _type
  1372. #define CALLBACK_API(_type, _name) pascal _type (*_name)
  1373. #define CALLBACK_API_C(_type, _name) _type (*_name)
  1374. #define CALLBACK_API_STDCALL(_type, _name) pascal _type (*_name)
  1375. #define CALLBACK_API_C_STDCALL(_type, _name) _type (*_name)
  1376. #elif !FUNCTION_PASCAL && FUNCTION_DECLSPEC && !FUNCTION_WIN32CC
  1377. /* compiler supports __declspec() */
  1378. #define EXTERN_API(_type) extern __declspec(dllimport) _type
  1379. #define EXTERN_API_C(_type) extern __declspec(dllimport) _type
  1380. #define EXTERN_API_STDCALL(_type) extern __declspec(dllimport) _type
  1381. #define EXTERN_API_C_STDCALL(_type) extern __declspec(dllimport) _type
  1382. #define DEFINE_API(_type) __declspec(dllexport) _type
  1383. #define DEFINE_API_C(_type) __declspec(dllexport) _type
  1384. #define DEFINE_API_STDCALL(_type) __declspec(dllexport) _type
  1385. #define DEFINE_API_C_STDCALL(_type) __declspec(dllexport) _type
  1386. #define CALLBACK_API(_type, _name) _type ( * _name)
  1387. #define CALLBACK_API_C(_type, _name) _type ( * _name)
  1388. #define CALLBACK_API_STDCALL(_type, _name) _type ( * _name)
  1389. #define CALLBACK_API_C_STDCALL(_type, _name) _type ( * _name)
  1390. #elif !FUNCTION_PASCAL && FUNCTION_DECLSPEC && FUNCTION_WIN32CC
  1391. /* compiler supports __declspec() and __cdecl */
  1392. #define EXTERN_API(_type) __declspec(dllimport) _type __cdecl
  1393. #define EXTERN_API_C(_type) __declspec(dllimport) _type __cdecl
  1394. #define EXTERN_API_STDCALL(_type) __declspec(dllimport) _type __stdcall
  1395. #define EXTERN_API_C_STDCALL(_type) __declspec(dllimport) _type __stdcall
  1396. #define DEFINE_API(_type) __declspec(dllexport) _type __cdecl
  1397. #define DEFINE_API_C(_type) __declspec(dllexport) _type __cdecl
  1398. #define DEFINE_API_STDCALL(_type) __declspec(dllexport) _type __stdcall
  1399. #define DEFINE_API_C_STDCALL(_type) __declspec(dllexport) _type __stdcall
  1400. #define CALLBACK_API(_type, _name) _type (__cdecl * _name)
  1401. #define CALLBACK_API_C(_type, _name) _type (__cdecl * _name)
  1402. #define CALLBACK_API_STDCALL(_type, _name) _type (__stdcall * _name)
  1403. #define CALLBACK_API_C_STDCALL(_type, _name) _type (__stdcall * _name)
  1404. #elif !FUNCTION_PASCAL && !FUNCTION_DECLSPEC && FUNCTION_WIN32CC
  1405. /* compiler supports __cdecl */
  1406. #define EXTERN_API(_type) _type __cdecl
  1407. #define EXTERN_API_C(_type) _type __cdecl
  1408. #define EXTERN_API_STDCALL(_type) _type __stdcall
  1409. #define EXTERN_API_C_STDCALL(_type) _type __stdcall
  1410. #define DEFINE_API(_type) _type __cdecl
  1411. #define DEFINE_API_C(_type) _type __cdecl
  1412. #define DEFINE_API_STDCALL(_type) _type __stdcall
  1413. #define DEFINE_API_C_STDCALL(_type) _type __stdcall
  1414. #define CALLBACK_API(_type, _name) _type (__cdecl * _name)
  1415. #define CALLBACK_API_C(_type, _name) _type (__cdecl * _name)
  1416. #define CALLBACK_API_STDCALL(_type, _name) _type (__stdcall * _name)
  1417. #define CALLBACK_API_C_STDCALL(_type, _name) _type (__stdcall * _name)
  1418. #else
  1419. /* compiler supports no extensions */
  1420. #define EXTERN_API(_type) extern _type
  1421. #define EXTERN_API_C(_type) extern _type
  1422. #define EXTERN_API_STDCALL(_type) extern _type
  1423. #define EXTERN_API_C_STDCALL(_type) extern _type
  1424. #define DEFINE_API(_type) _type
  1425. #define DEFINE_API_C(_type) _type
  1426. #define DEFINE_API_STDCALL(_type) _type
  1427. #define DEFINE_API_C_STDCALL(_type) _type
  1428. #define CALLBACK_API(_type, _name) _type ( * _name)
  1429. #define CALLBACK_API_C(_type, _name) _type ( * _name)
  1430. #define CALLBACK_API_STDCALL(_type, _name) _type ( * _name)
  1431. #define CALLBACK_API_C_STDCALL(_type, _name) _type ( * _name)
  1432. #undef pascal
  1433. #define pascal
  1434. #endif
  1435. /* On classic 68k, some callbacks are register based. The only way to */
  1436. /* write them in C is to make a function with no parameters and a void */
  1437. /* return. Inside the function you manually get and set registers. */
  1438. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1439. #define CALLBACK_API_REGISTER68K(_type, _name, _params) CALLBACK_API(void, _name)()
  1440. #else
  1441. #define CALLBACK_API_REGISTER68K(_type, _name, _params) CALLBACK_API(_type, _name)_params
  1442. #endif
  1443. /****************************************************************************************************
  1444. Set up TARGET_API_*_* values
  1445. ****************************************************************************************************/
  1446. #if TARGET_OS_MAC
  1447. #if !defined(TARGET_API_MAC_OS8) && !defined(TARGET_API_MAC_OSX) && !defined(TARGET_API_MAC_CARBON)
  1448. /* No TARGET_API_MAC_* predefined on command line */
  1449. #if TARGET_RT_MAC_MACHO
  1450. /* Looks like MachO style compiler */
  1451. #define TARGET_API_MAC_OS8 0
  1452. #define TARGET_API_MAC_CARBON 1
  1453. #define TARGET_API_MAC_OSX 1
  1454. #elif defined(TARGET_CARBON) && TARGET_CARBON
  1455. /* grandfather in use of TARGET_CARBON */
  1456. #define TARGET_API_MAC_OS8 0
  1457. #define TARGET_API_MAC_CARBON 1
  1458. #define TARGET_API_MAC_OSX 0
  1459. #elif TARGET_CPU_PPC && TARGET_RT_MAC_CFM
  1460. /* Looks like CFM style PPC compiler */
  1461. #define TARGET_API_MAC_OS8 1
  1462. #define TARGET_API_MAC_CARBON 0
  1463. #define TARGET_API_MAC_OSX 0
  1464. #else
  1465. /* 68k or some other compiler */
  1466. #define TARGET_API_MAC_OS8 1
  1467. #define TARGET_API_MAC_CARBON 0
  1468. #define TARGET_API_MAC_OSX 0
  1469. #endif /* */
  1470. #else
  1471. #ifndef TARGET_API_MAC_OS8
  1472. #define TARGET_API_MAC_OS8 0
  1473. #endif /* !defined(TARGET_API_MAC_OS8) */
  1474. #ifndef TARGET_API_MAC_OSX
  1475. #define TARGET_API_MAC_OSX TARGET_RT_MAC_MACHO
  1476. #endif /* !defined(TARGET_API_MAC_OSX) */
  1477. #ifndef TARGET_API_MAC_CARBON
  1478. #define TARGET_API_MAC_CARBON TARGET_API_MAC_OSX
  1479. #endif /* !defined(TARGET_API_MAC_CARBON) */
  1480. #endif /* !defined(TARGET_API_MAC_OS8) && !defined(TARGET_API_MAC_OSX) && !defined(TARGET_API_MAC_CARBON) */
  1481. #if TARGET_API_MAC_OS8 && TARGET_API_MAC_OSX
  1482. #error TARGET_API_MAC_OS8 and TARGET_API_MAC_OSX are mutually exclusive
  1483. #endif /* TARGET_API_MAC_OS8 && TARGET_API_MAC_OSX */
  1484. #if !TARGET_API_MAC_OS8 && !TARGET_API_MAC_CARBON && !TARGET_API_MAC_OSX
  1485. #error At least one of TARGET_API_MAC_* must be true
  1486. #endif /* !TARGET_API_MAC_OS8 && !TARGET_API_MAC_CARBON && !TARGET_API_MAC_OSX */
  1487. #else
  1488. #define TARGET_API_MAC_OS8 0
  1489. #define TARGET_API_MAC_CARBON 0
  1490. #define TARGET_API_MAC_OSX 0
  1491. #endif /* TARGET_OS_MAC */
  1492. /* Support source code still using TARGET_CARBON */
  1493. #ifndef TARGET_CARBON
  1494. #if TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8
  1495. #define TARGET_CARBON 1
  1496. #else
  1497. #define TARGET_CARBON 0
  1498. #endif /* TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8 */
  1499. #endif /* !defined(TARGET_CARBON) */
  1500. /* Set forCarbon to 0 if it's not already defined */
  1501. #ifndef forCarbon
  1502. #define forCarbon 0
  1503. #endif /* !defined(forCarbon) */
  1504. /****************************************************************************************************
  1505. Backward compatibility for clients expecting 2.x version on ConditionalMacros.h
  1506. GENERATINGPOWERPC - Compiler is generating PowerPC instructions
  1507. GENERATING68K - Compiler is generating 68k family instructions
  1508. GENERATING68881 - Compiler is generating mc68881 floating point instructions
  1509. GENERATINGCFM - Code being generated assumes CFM calling conventions
  1510. CFMSYSTEMCALLS - No A-traps. Systems calls are made using CFM and UPP's
  1511. PRAGMA_ALIGN_SUPPORTED - Compiler supports: #pragma options align=mac68k/power/reset
  1512. PRAGMA_IMPORT_SUPPORTED - Compiler supports: #pragma import on/off/reset
  1513. CGLUESUPPORTED - Clients can use all lowercase toolbox functions that take C strings instead of pascal strings
  1514. ****************************************************************************************************/
  1515. #if !TARGET_API_MAC_CARBON
  1516. #define GENERATINGPOWERPC TARGET_CPU_PPC
  1517. #define GENERATING68K TARGET_CPU_68K
  1518. #define GENERATING68881 TARGET_RT_MAC_68881
  1519. #define GENERATINGCFM TARGET_RT_MAC_CFM
  1520. #define CFMSYSTEMCALLS TARGET_RT_MAC_CFM
  1521. #ifndef CGLUESUPPORTED
  1522. #define CGLUESUPPORTED 0
  1523. #endif /* !defined(CGLUESUPPORTED) */
  1524. #ifndef OLDROUTINELOCATIONS
  1525. #define OLDROUTINELOCATIONS 0
  1526. #endif /* !defined(OLDROUTINELOCATIONS) */
  1527. #define PRAGMA_ALIGN_SUPPORTED PRAGMA_STRUCT_ALIGN
  1528. #define PRAGMA_IMPORT_SUPPORTED PRAGMA_IMPORT
  1529. #else
  1530. /* Carbon code should not use old conditionals */
  1531. #define PRAGMA_ALIGN_SUPPORTED ..PRAGMA_ALIGN_SUPPORTED_is_obsolete..
  1532. #define GENERATINGPOWERPC ..GENERATINGPOWERPC_is_obsolete..
  1533. #define GENERATING68K ..GENERATING68K_is_obsolete..
  1534. #define GENERATING68881 ..GENERATING68881_is_obsolete..
  1535. #define GENERATINGCFM ..GENERATINGCFM_is_obsolete..
  1536. #define CFMSYSTEMCALLS ..CFMSYSTEMCALLS_is_obsolete..
  1537. #endif /* !TARGET_API_MAC_CARBON */
  1538. /****************************************************************************************************
  1539. OLDROUTINENAMES - "Old" names for Macintosh system calls are allowed in source code.
  1540. (e.g. DisposPtr instead of DisposePtr). The names of system routine
  1541. are now more sensitive to change because CFM binds by name. In the
  1542. past, system routine names were compiled out to just an A-Trap.
  1543. Macros have been added that each map an old name to its new name.
  1544. This allows old routine names to be used in existing source files,
  1545. but the macros only work if OLDROUTINENAMES is true. This support
  1546. will be removed in the near future. Thus, all source code should
  1547. be changed to use the new names! You can set OLDROUTINENAMES to false
  1548. to see if your code has any old names left in it.
  1549. ****************************************************************************************************/
  1550. #ifndef OLDROUTINENAMES
  1551. #define OLDROUTINENAMES 0
  1552. #endif /* !defined(OLDROUTINENAMES) */
  1553. /****************************************************************************************************
  1554. The following macros isolate the use of 68K inlines in function prototypes.
  1555. On the Mac OS under the Classic 68K runtime, function prototypes were followed
  1556. by a list of 68K opcodes which the compiler inserted in the generated code instead
  1557. of a JSR. Under Classic 68K on the Mac OS, this macro will put the opcodes
  1558. in the right syntax. For all other OS's and runtimes the macro suppress the opcodes.
  1559. Example:
  1560. EXTERN_P void DrawPicture(PicHandle myPicture, const Rect *dstRect)
  1561. ONEWORDINLINE(0xA8F6);
  1562. ****************************************************************************************************/
  1563. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1564. #define ONEWORDINLINE(w1) = w1
  1565. #define TWOWORDINLINE(w1,w2) = {w1,w2}
  1566. #define THREEWORDINLINE(w1,w2,w3) = {w1,w2,w3}
  1567. #define FOURWORDINLINE(w1,w2,w3,w4) = {w1,w2,w3,w4}
  1568. #define FIVEWORDINLINE(w1,w2,w3,w4,w5) = {w1,w2,w3,w4,w5}
  1569. #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6) = {w1,w2,w3,w4,w5,w6}
  1570. #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7) = {w1,w2,w3,w4,w5,w6,w7}
  1571. #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8) = {w1,w2,w3,w4,w5,w6,w7,w8}
  1572. #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9) = {w1,w2,w3,w4,w5,w6,w7,w8,w9}
  1573. #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10) = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10}
  1574. #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11) = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11}
  1575. #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}
  1576. #else
  1577. #define ONEWORDINLINE(w1)
  1578. #define TWOWORDINLINE(w1,w2)
  1579. #define THREEWORDINLINE(w1,w2,w3)
  1580. #define FOURWORDINLINE(w1,w2,w3,w4)
  1581. #define FIVEWORDINLINE(w1,w2,w3,w4,w5)
  1582. #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6)
  1583. #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7)
  1584. #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8)
  1585. #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9)
  1586. #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10)
  1587. #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11)
  1588. #define TWELVEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12)
  1589. #endif
  1590. /****************************************************************************************************
  1591. TARGET_CARBON - default: false. Switches all of the above as described. Overrides all others
  1592. - NOTE: If you set TARGET_CARBON to 1, then the other switches will be setup by
  1593. ConditionalMacros, and should not be set manually.
  1594. If you wish to do development for pre-Carbon Systems, you can set the following:
  1595. OPAQUE_TOOLBOX_STRUCTS - default: false. True for Carbon builds, hides struct fields.
  1596. OPAQUE_UPP_TYPES - default: false. True for Carbon builds, UPP types are unique and opaque.
  1597. ACCESSOR_CALLS_ARE_FUNCTIONS - default: false. True for Carbon builds, enables accessor functions.
  1598. CALL_NOT_IN_CARBON - default: true. False for Carbon builds, hides calls not supported in Carbon.
  1599. Specifically, if you are building a non-Carbon application (one that links against InterfaceLib)
  1600. but you wish to use some of the accessor functions, you can set ACCESSOR_CALLS_ARE_FUNCTIONS to 1
  1601. and link with CarbonAccessors.o, which implements just the accessor functions. This will help you
  1602. preserve source compatibility between your Carbon and non-Carbon application targets.
  1603. MIXEDMODE_CALLS_ARE_FUNCTIONS - deprecated.
  1604. ****************************************************************************************************/
  1605. #if TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8
  1606. #ifndef OPAQUE_TOOLBOX_STRUCTS
  1607. #define OPAQUE_TOOLBOX_STRUCTS 1
  1608. #endif /* !defined(OPAQUE_TOOLBOX_STRUCTS) */
  1609. #ifndef OPAQUE_UPP_TYPES
  1610. #define OPAQUE_UPP_TYPES 1
  1611. #endif /* !defined(OPAQUE_UPP_TYPES) */
  1612. #ifndef ACCESSOR_CALLS_ARE_FUNCTIONS
  1613. #define ACCESSOR_CALLS_ARE_FUNCTIONS 1
  1614. #endif /* !defined(ACCESSOR_CALLS_ARE_FUNCTIONS) */
  1615. #ifndef CALL_NOT_IN_CARBON
  1616. #define CALL_NOT_IN_CARBON 0
  1617. #endif /* !defined(CALL_NOT_IN_CARBON) */
  1618. #ifndef MIXEDMODE_CALLS_ARE_FUNCTIONS
  1619. #define MIXEDMODE_CALLS_ARE_FUNCTIONS 1
  1620. #endif /* !defined(MIXEDMODE_CALLS_ARE_FUNCTIONS) */
  1621. #else
  1622. #ifndef OPAQUE_TOOLBOX_STRUCTS
  1623. #define OPAQUE_TOOLBOX_STRUCTS 0
  1624. #endif /* !defined(OPAQUE_TOOLBOX_STRUCTS) */
  1625. #ifndef OPAQUE_UPP_TYPES
  1626. #define OPAQUE_UPP_TYPES 0
  1627. #endif /* !defined(OPAQUE_UPP_TYPES) */
  1628. #ifndef ACCESSOR_CALLS_ARE_FUNCTIONS
  1629. #define ACCESSOR_CALLS_ARE_FUNCTIONS 0
  1630. #endif /* !defined(ACCESSOR_CALLS_ARE_FUNCTIONS) */
  1631. /*
  1632. * It's possible to have ACCESSOR_CALLS_ARE_FUNCTIONS set to true and OPAQUE_TOOLBOX_STRUCTS
  1633. * set to false, but not the other way around, so make sure the defines are not set this way.
  1634. */
  1635. #if OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  1636. #error OPAQUE_TOOLBOX_STRUCTS cannot be true when ACCESSOR_CALLS_ARE_FUNCTIONS is false
  1637. #endif /* OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS */
  1638. #ifndef CALL_NOT_IN_CARBON
  1639. #define CALL_NOT_IN_CARBON 1
  1640. #endif /* !defined(CALL_NOT_IN_CARBON) */
  1641. #ifndef MIXEDMODE_CALLS_ARE_FUNCTIONS
  1642. #define MIXEDMODE_CALLS_ARE_FUNCTIONS 0
  1643. #endif /* !defined(MIXEDMODE_CALLS_ARE_FUNCTIONS) */
  1644. #endif /* TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8 */
  1645. #if TARGET_RT_MAC_MACHO && TARGET_RT_LITTLE_ENDIAN
  1646. #define OLD_COMPONENT_GLUE 1
  1647. #endif
  1648. #endif /* __CONDITIONALMACROS__ */