【Delphi】条件编译指令说明(来自XE6文档)
Predefined Conditionals
The following standard conditional symbols are defined:
In the table column heads:
-
is the 32-bit Windows Delphi compiler.
-
is the 64-bit Windows Delphi compiler.
-
is the Mac OS X Delphi compiler.
-
is the Delphi mobile compiler for iOS Devices.
-
is the Delphi mobile compiler for iOS Simulators.
-
is the Delphi mobile compiler for Android emulators and .
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 CompilerVersion, RTLVersion and other constants:
{$IFDEF CONDITIONALEXPRESSIONS} {$IF CompilerVersion >= 17.0} {$DEFINE HAS_INLINE} {$IFEND} {$IF RTLVersion >= 14.0} {$DEFINE HAS_ERROUTPUT} {$IFEND} {$ENDIF}
See the for a list of version numbers associated with various released Delphi compilers.
Predefined Constants
Constants can be more powerful than conditionals because you can use constants programmatically in Delphi code. Conditionals, on the other hand, are accepted only inside conditional compiler directives such as {$IF} and {$IFDEF}.