global compiler directives

From Lazarus wiki
Revision as of 14:23, 19 February 2021 by Kai Burghardt (talk | contribs) (→‎Syntax: reword short description to be more accurate)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Deutsch (de) English (en) français (fr) русский (ru)

Free Pascal supports compiler directives in the source file. Basically the same directives as in Turbo Pascal, Delphi and Apple Pascal (Mac OS) pascal compilers are supported. Some are recognized for compatibility only, and have no effect.

Syntax

General:

Specific:

Code generation

Data inclusion

Paths

Target-dependent

Novell NetWare only

Palm OS and Garnet OS only

  • {$appID} defines four-character application identifier
  • {$appName} determines the name of the application

Windows-based systems

  • {$imageBase} specifies DLL image base location
  • {$minStackSize}
  • {$maxStackSize}
  • {$setPEFlags}
  • {$version} defines version number of a DLL

Miscellaneous

Compile-time data

Ignored

  • {$description}: introduced for compatibility and as of FPC 3.0.4 ignored
  • {$G} would generate 80286 code with TP
  • {$localSymbols} or {$L}
  • {$N} (numeric processing)
  • {$O} enabled level 2 optimizations. It is not recognized anymore since FPC 2.0.0. Use {$optimization} instead.
  • {$weakPackageUnit}

See also

Directives, definitions and conditionals definitions
global compiler directives • local compiler directives

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