Difference between revisions of "local compiler directives"

From Free Pascal wiki
Jump to navigationJump to search
(language)
Line 18: Line 18:
 
*[[sFputype|$FPUTYPE]] compiles according to FPU type
 
*[[sFputype|$FPUTYPE]] compiles according to FPU type
 
*[[sGoto|$GOTO]] enables Goto and Label
 
*[[sGoto|$GOTO]] enables Goto and Label
*[[sH|$H or $LONGSTRINGS]] determines string type for reserved word [[string]].
+
*[[sH|$H or $LONGSTRINGS]] determines string type for reserved word [[String|string]].
 
*[[sHppemit|$HPPEMIT]] ignored by compiler.
 
*[[sHppemit|$HPPEMIT]] ignored by compiler.
 
*[[sImplicitexeptions|$IMPLICITEXCEPTIONS]] helps to avoid memory leaks.
 
*[[sImplicitexeptions|$IMPLICITEXCEPTIONS]] helps to avoid memory leaks.

Revision as of 01:06, 27 October 2015

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

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

Local compiler directives

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 directives 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 directives for Darwin-based operating systems only

Local compiler directives 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.
Directives, definitions and conditionals definitions
global compiler directives • local compiler directives

Conditional Compiler Options • Conditional compilation • Macros and Conditionals • Platform defines
$IF