큰꼼의 세상

The following standard conditional symbols are defined:

CategorySymbolDCC32  DCC64  
  Since XE2  
  DCCOSX  
  Since XE2  
  DCCIOSARM  
  Since XE3  
  DCCIOS32  
  Since XE3  
  DCCAARM  
In XE5
  DCCIOSARM64  
  Since XE8  
Comments
CompilerDCCDEFINEDDEFINEDDEFINEDDEFINEDDEFINEDDEFINEDDEFINED
VER300 

For a list of compiler versions, see Compiler Versions.
DEFINEDDEFINEDDEFINEDDEFINEDDEFINEDDEFINEDDEFINEDFor Delphi Seattle, compiler has VER300 defined.
PlatformCONSOLEDEFINEDDEFINEDDEFINEDDEFINEDDEFINEDDEFINEDDEFINEDDefined if an application is being compiled as a console application.
IOSnot definednot definednot definedDEFINEDDEFINEDnot definedDEFINEDDefined if the target platform is iOS.
*New* in XE4/iOS
IOS32not definednot definednot definedDEFINEDDEFINEDnot definednot definedDefined if the target platform is iOS32.
Since XE8/iOSarm64
IOS64not definednot definednot definednot definednot definednot definedDEFINEDDefined if the target platform is iOS64.
Since XE8/iOSarm64
NATIVECODEDEFINEDDEFINEDDEFINEDDEFINEDDEFINEDDEFINEDDEFINEDSince Delphi.Net
MSWINDOWSDEFINEDDEFINEDnot definednot definednot definednot definednot definedIndicates that the operating environment is Windows. Use MSWINDOWS to test for any flavor of the Windows platform instead of WIN32.
WIN32DEFINEDnot definednot definednot definednot definednot definednot definedTarget platform is the native 32-bit Windows platform.
WIN64not definedDEFINEDnot definednot definednot definednot definednot definedTarget platform is 64-bit Windows. 
*New* in XE2/x64
MACOSnot definednot definedDEFINEDDEFINEDDEFINEDnot definedDEFINEDTarget platform is Mac OS X. 
*New* in XE2/OSX
MACOS32not definednot definedDEFINEDDEFINEDDEFINEDnot definednot definedTarget platform is 32-bit Mac OS X. 
*New* in XE2/OSX
MACOS64not definednot definednot definednot definednot definednot definedDEFINEDTarget platform is 64-bit Mac OS X. 
*New* in XE8/OSX
LINUXnot definednot definednot definednot definednot definednot definednot definedSince Kylix
LINUX32not definednot definednot definednot definednot definednot definednot definedSince Kylix
POSIXnot definednot definedDEFINEDDEFINEDDEFINEDDEFINEDDEFINEDSince Kylix
POSIX32not definednot definedDEFINEDDEFINEDDEFINEDDEFINEDDEFINEDSince Kylix
ANDROIDnot definednot definednot definednot definednot definedDEFINEDnot definedDefined if the target platform is Android.
*New in XE5
CPUCPUARMnot definednot definednot definedDEFINEDnot definedDEFINEDDEFINEDDefined if the CPU is based on the ARM architecture, such as the Delphi mobile compiler for the iOS device (DCCIOSARM.EXE). 
*New* in XE4/iOS
CPU386DEFINEDnot definedDEFINEDnot definedDEFINEDnot definednot definedIndicates that the CPU is an Intel 386 or later.
CPUX86DEFINEDnot definedDEFINEDnot definedDEFINEDnot definednot definedCPU is an Intel 386 or later on any platform. 
*New* in XE2/x64
CPUX64not definedDEFINEDnot definednot definednot definednot definednot definedThe CPU supports the x86-64 instruction set, and is in a 64-bit environment. 
*New* in XE2/x64
CPU32BITSDEFINEDnot definedDEFINEDDEFINEDDEFINEDDEFINEDnot definedThe CPU is in a 32-bit environment, such as DCC32.EXE. 
*New* in XE8
CPU64BITSnot definedDEFINEDnot definednot definednot definednot definedDEFINEDThe CPU is in a 64-bit environment, such as DCC64.EXE. 
*New* in XE8
CPUARM32not definednot definednot definedDEFINEDnot definedDEFINEDnot definedThe CPU is in a 32-bit ARM environment, such as DCCIOSARM.EXE. 
*New* in XE8
CPUARM64not definednot definednot definednot definednot definednot definedDEFINEDThe CPU is in a 64-bit ARM environment, such as DCCIOSARM64.EXE. 
*New* in XE8
Availability
ALIGN_STACKnot definednot definedDEFINEDnot definedDEFINEDnot definednot definedDefined in code that may be shared with the OS X compiler and another compiler on another platform such as Linux that does not have a rigid stack alignment requirement. For more information, see Eli Boling's blog at http://blogs.embarcadero.com/eboling/2009/05/20/5607 . 
*New* in XE2/OSX
ASSEMBLERDEFINEDDEFINEDDEFINEDnot definedDEFINEDnot definednot definedAssembler syntax is accepted.
AUTOREFCOUNTnot definednot definednot definedDEFINEDDEFINEDDEFINEDDEFINEDDefined for compilers that use automatic reference counting, such as the Delphi mobile compilers. 
*New* in XE4/iOS
EXTERNALLINKERnot definednot definednot definedDEFINEDnot definedDEFINEDDEFINEDDefined for compilers that have an external linker and the LLVM code generator; the Delphi mobile compilers have the external ld linker and use LLVM as code generator. 
*New* in XE4/iOS
UNICODEDEFINEDDEFINEDDEFINEDDEFINEDDEFINEDDEFINEDDEFINEDUNICODE is defined as the default string type.
CONDITIONALEXPRESSIONSDEFINEDDEFINEDDEFINEDDEFINEDDEFINEDDEFINEDDEFINEDTests for the use of the $IF directive.
ELFnot definednot definednot definednot definednot definednot definednot definedDefined when targeting Executable and Linkable Format (ELF) files.
NEXTGENnot definednot definednot definedDEFINEDDEFINEDDEFINEDDEFINEDDefined for compilers (such as the Delphi mobile compilers) that use "next-generation" language features, such as 0-based strings. 
*New* in XE4/iOS
PC_MAPPED_EXCEPTIONSnot definednot definedDEFINEDnot definedDEFINEDnot definednot definedDefined when compiling on a platform or for a target platform that uses address maps instead of stack frames to unwind exceptions (such as OS X). 
*New* in XE2.
PICneverneverDEFINED if -P is specifiedneverDEFINED if -P is specifiedalways definedneverDefined for platforms that require Position-Independent Code (PIC), such as OS X.
UNDERSCOREIMPORTNAMEDEFINEDnot definedDEFINEDnot definedDEFINEDnot definednot definedDefined for compilers that add a leading underscore (for example, in names of dynamic libraries imported from Mac OS). 
*New* in XE4/iOS
WEAKREFnot definednot definednot definedDEFINEDDEFINEDDEFINEDDEFINEDDefined for compilers that can use weak references (the [weak] attribute). 
*New* in XE4/iOS
WEAKINSTREFnot definednot definednot definedDEFINEDDEFINEDDEFINEDDEFINEDDefined when weak references are defined for instances. 
*New* in XE4/iOS
WEAKINTFREFnot definednot definednot definedDEFINEDDEFINEDDEFINEDDEFINEDDefined when weak references are defined for interfaces. 
*New* in XE4/iOS

In the table column heads:

  • DCC32 is the 32-bit Windows Delphi compiler.
  • DCC64 is the 64-bit Windows Delphi compiler.
  • DCCOSX is the Mac OS X Delphi compiler.
  • DCCIOSARM is the Delphi compiler for 32-bit iOS Devices.
  • DCCIOS32 is the Delphi compiler for iOS Simulators.
  • DCCAARM.EXE is the Delphi compiler for Android devices.
  • DCCIOSARM64 is the Delphi compiler for 64-bit iOS devices.

Using Conditional Defines for the Compiler Version

For example, to determine the version of the compiler and run-time library that were used to compile your code, you can use {$IF} with the CompilerVersionRTLVersion and other constants:

 {$IFDEF CONDITIONALEXPRESSIONS}
    {$IF CompilerVersion >= 17.0}
      {$DEFINE HAS_INLINE}
    {$IFEND}
    {$IF RTLVersion >= 14.0}
      {$DEFINE HAS_ERROUTPUT}
    {$IFEND}
 {$ENDIF}

See the table of Compiler Versions for a list of version numbers associated with various released Delphi compilers.


출처 : http://docwiki.embarcadero.com/RADStudio/Seattle/en/Conditional_compilation_(Delphi)