ConditionalMacros.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:71k
- /*
- File: ConditionalMacros.h
-
- Contains: Set up for compiler independent conditionals
-
- Version: Technology: Universal Interface Files 3.3
- Release: QuickTime 6.0.2
-
- Copyright: (c) 1993-2001 by Apple Computer, Inc., all rights reserved
-
- Bugs?: For bug reports, consult the following page on
- the World Wide Web:
-
- http://developer.apple.com/bugreporter/
-
- */
- #ifndef __CONDITIONALMACROS__
- #define __CONDITIONALMACROS__
- /****************************************************************************************************
- UNIVERSAL_INTERFACES_VERSION
-
- 0x0330 => version 3.3
- 0x0320 => version 3.2
- 0x0310 => version 3.1
- 0x0301 => version 3.0.1
- 0x0300 => version 3.0
- 0x0210 => version 2.1
- This conditional did not exist prior to version 2.1
- ****************************************************************************************************/
- #define UNIVERSAL_INTERFACES_VERSION 0x0330
- /****************************************************************************************************
- TARGET_CPU_*
- These conditionals specify which microprocessor instruction set is being
- generated. At most one of these is true, the rest are false.
- TARGET_CPU_PPC - Compiler is generating PowerPC instructions
- TARGET_CPU_68K - Compiler is generating 680x0 instructions
- TARGET_CPU_X86 - Compiler is generating x86 instructions
- TARGET_CPU_MIPS - Compiler is generating MIPS instructions
- TARGET_CPU_SPARC - Compiler is generating Sparc instructions
- TARGET_CPU_ALPHA - Compiler is generating Dec Alpha instructions
- TARGET_OS_*
- These conditionals specify in which Operating System the generated code will
- run. At most one of the these is true, the rest are false.
- TARGET_OS_MAC - Generate code will run under Mac OS
- TARGET_OS_WIN32 - Generate code will run under 32-bit Windows
- TARGET_OS_UNIX - Generate code will run under some unix
- TARGET_RT_*
- These conditionals specify in which runtime the generated code will
- run. This is needed when the OS and CPU support more than one runtime
- (e.g. MacOS on 68K supports CFM68K and Classic 68k).
- TARGET_RT_LITTLE_ENDIAN - Generated code uses little endian format for integers
- TARGET_RT_BIG_ENDIAN - Generated code uses big endian format for integers
- TARGET_RT_MAC_CFM - TARGET_OS_MAC is true and CFM68K or PowerPC CFM (TVectors) are used
- TARGET_RT_MAC_MACHO - TARGET_OS_MAC is true and Mach-O style runtime
- TARGET_RT_MAC_68881 - TARGET_OS_MAC is true and 68881 floating point instructions used
- TARGET__API_*_*
- These conditionals are used to differentiate between sets of API's on the same
- processor under the same OS. The first section after _API_ is the OS. The
- second section is the API set. Unlike TARGET_OS_ and TARGET_CPU_, these
- conditionals are not mutally exclusive. This file will attempt to auto-configure
- all TARGET_API_*_* values, but will often need a TARGET_API_*_* value predefined
- in order to disambiguate.
-
- TARGET_API_MAC_OS8 - Code is being compiled to run on System 7 through Mac OS 8.x
- TARGET_API_MAC_CARBON - Code is being compiled to run on Mac OS 8 and Mac OS X via CarbonLib
- TARGET_API_MAC_OSX - Code is being compiled to run on Mac OS X
- PRAGMA_*
- These conditionals specify whether the compiler supports particular #pragma's
-
- PRAGMA_IMPORT - Compiler supports: #pragma import on/off/reset
- PRAGMA_ONCE - Compiler supports: #pragma once
- PRAGMA_STRUCT_ALIGN - Compiler supports: #pragma options align=mac68k/power/reset
- PRAGMA_STRUCT_PACK - Compiler supports: #pragma pack(n)
- PRAGMA_STRUCT_PACKPUSH - Compiler supports: #pragma pack(push, n)/pack(pop)
- PRAGMA_ENUM_PACK - Compiler supports: #pragma options(!pack_enums)
- PRAGMA_ENUM_ALWAYSINT - Compiler supports: #pragma enumsalwaysint on/off/reset
- PRAGMA_ENUM_OPTIONS - Compiler supports: #pragma options enum=int/small/reset
- FOUR_CHAR_CODE
- This conditional does the proper byte swapping to assue that a four character code (e.g. 'TEXT')
- is compiled down to the correct value on all compilers.
- FOUR_CHAR_CODE('abcd') - Convert a four-char-code to the correct 32-bit value
- TYPE_*
- These conditionals specify whether the compiler supports particular types.
- TYPE_LONGLONG - Compiler supports "long long" 64-bit integers
- TYPE_BOOL - Compiler supports "bool"
- TYPE_EXTENDED - Compiler supports "extended" 80/96 bit floating point
- FUNCTION_*
- These conditionals specify whether the compiler supports particular language extensions
- to function prototypes and definitions.
- FUNCTION_PASCAL - Compiler supports "pascal void Foo()"
- FUNCTION_DECLSPEC - Compiler supports "__declspec(xxx) void Foo()"
- FUNCTION_WIN32CC - Compiler supports "void __cdecl Foo()" and "void __stdcall Foo()"
- ****************************************************************************************************/
- #if defined(__MRC__)
- /*
- MrC[pp] compiler from Apple Computer, Inc.
- */
- #define TARGET_CPU_PPC 1
- #define TARGET_CPU_68K 0
- #define TARGET_CPU_X86 0
- #define TARGET_CPU_MIPS 0
- #define TARGET_CPU_SPARC 0
- #define TARGET_CPU_ALPHA 0
- #define TARGET_OS_MAC 1
- #define TARGET_OS_WIN32 0
- #define TARGET_OS_UNIX 0
- #define TARGET_RT_LITTLE_ENDIAN 0
- #define TARGET_RT_BIG_ENDIAN 1
- #define TARGET_RT_MAC_CFM 1
- #define TARGET_RT_MAC_MACHO 0
- #define TARGET_RT_MAC_68881 0
- #if (__MRC__ > 0x0200) && (__MRC__ < 0x0700)
- #define PRAGMA_IMPORT 1
- #else
- #define PRAGMA_IMPORT 0
- #endif
- #define PRAGMA_STRUCT_ALIGN 1
- #define PRAGMA_ONCE 1
- #define PRAGMA_STRUCT_PACK 0
- #define PRAGMA_STRUCT_PACKPUSH 0
- #define PRAGMA_ENUM_PACK 1
- #define PRAGMA_ENUM_ALWAYSINT 0
- #define PRAGMA_ENUM_OPTIONS 0
- #define FOUR_CHAR_CODE(x) (x)
-
- #if (__MRC__ > 0x0300) && (__MRC__ < 0x0700)
- #if __option(longlong)
- #define TYPE_LONGLONG 1
- #else
- #define TYPE_LONGLONG 0
- #endif
- #if __option(bool)
- #define TYPE_BOOL 1
- #else
- #define TYPE_BOOL 0
- #endif
- #define SLASH_INCLUDES_UNSUPPORTED !__option(unix_includes)
- #else
- #define TYPE_LONGLONG 0
- #define TYPE_BOOL 0
- #define SLASH_INCLUDES_UNSUPPORTED 1
- #endif
- #define TYPE_EXTENDED 0
-
- #define FUNCTION_PASCAL 1
- #define FUNCTION_DECLSPEC 0
- #define FUNCTION_WIN32CC 0
-
- #elif defined(__SC__) && (defined(MPW_CPLUS) || defined(MPW_C))
- /*
- SC[pp] compiler from Apple Computer, Inc.
- */
- #define TARGET_CPU_PPC 0
- #define TARGET_CPU_68K 1
- #define TARGET_CPU_X86 0
- #define TARGET_CPU_MIPS 0
- #define TARGET_CPU_SPARC 0
- #define TARGET_CPU_ALPHA 0
- #define TARGET_OS_MAC 1
- #define TARGET_OS_WIN32 0
- #define TARGET_OS_UNIX 0
- #define TARGET_RT_LITTLE_ENDIAN 0
- #define TARGET_RT_BIG_ENDIAN 1
- #if defined(__CFM68K__)
- #define TARGET_RT_MAC_CFM 1
- #else
- #define TARGET_RT_MAC_CFM 0
- #endif
- #define TARGET_RT_MAC_MACHO 0
- #if defined(mc68881)
- #define TARGET_RT_MAC_68881 1
- #else
- #define TARGET_RT_MAC_68881 0
- #endif
- #if TARGET_RT_MAC_CFM
- #define PRAGMA_IMPORT 1
- #if (__SC__ <= 0x0810)
- /* old versions of SC don't support