Difference between revisions of "local compiler directives"

From Free Pascal wiki
Jump to navigationJump to search
(Links corrected.)
Line 56: Line 56:
 
*[[sElseIf|$ELSEIF]] defines alternative and new branch conditional compilation.
 
*[[sElseIf|$ELSEIF]] defines alternative and new branch conditional compilation.
 
*[[sEndif|$ENDIF]] defines end of conditional compilation.
 
*[[sEndif|$ENDIF]] defines end of conditional compilation.
*[[sIf|$IF]] Begin of conditional compilation.
+
*[[$IF]] Begin of conditional compilation.
 
*[[sIfdef|$IFDEF]] Begin of conditional compilation.
 
*[[sIfdef|$IFDEF]] Begin of conditional compilation.
 
*[[sIfndef|$IFNDEF]] Begin of conditional compilation.
 
*[[sIfndef|$IFNDEF]] Begin of conditional compilation.

Revision as of 23:01, 13 October 2013

Deutsch (de) English (en) français (fr)

Local directives may be used more then once in a unit or program.

Local compiler direvtives

Conditional compilation

  • $ELSE defines alternative path in conditional compilation.
  • $ELSEIF defines alternative and new branch conditional compilation.
  • $ENDIF defines end of conditional compilation.
  • $IF Begin of conditional compilation.
  • $IFDEF Begin of conditional compilation.
  • $IFNDEF Begin of conditional compilation.
  • $IFOPT Begin of conditional compilation.

Self-defined compiler warnings, messages and hints

  • $ERROR display a self-defined error message.
  • $FATAL display a self-defined fatal error message.
  • $HINT displays a self-defined hint.
  • $HINTS enables self-defined hints.
  • $INFO display a self-defined information message.
  • $MESSAGE creates a self-defined information message.
  • $NOTE creates a self-defined note.
  • $NOTES enables the creation of self-defined notes.
  • $STOP display a self-defined fatal error message.
  • $WARNING creates a self-defined warning.
  • $WARNINGS enables self-defined warnings.

Local compiler direvtives for x86 processors only

  • $ASMMODE assembler mode.
  • $I386_XXX determines the assembler format.
  • $MMX enables optimizations for MMX processores.
  • $SATURATION Enables saturation (protection from memory-overflow) for MMX processores.
  • $MAXFPUREGISTERS determines the maximum number of floating-points registers to use.

Local compiler direvtives for Darwin-based operating systems only

Local compiler direvtives for MacPas mode only

The following directives are supported for compatibility with existing Pascal compilers for Mac OS:

Symbols

  • $DEFINEC enables definition of own symbols.
  • $SETC defines and assigns a symbol.
  • $UNDEFC undefines and unassigns a symbol.