Difference between revisions of "global compiler directives"

From Free Pascal wiki
(syntax: $pointerMath since)
(code generation: $S is in fact a local compiler directive, see https://bugs.freepascal.org/view.php?id=36012)
Line 21: Line 21:
 
* [[$libPrefix and $libSuffix|<syntaxhighlight lang="pascal" enclose="none">{$libPrefix}</syntaxhighlight>]] determines file name prefix a generated library
 
* [[$libPrefix and $libSuffix|<syntaxhighlight lang="pascal" enclose="none">{$libPrefix}</syntaxhighlight>]] determines file name prefix a generated library
 
* [[$libPrefix and $libSuffix|<syntaxhighlight lang="pascal" enclose="none">{$libSuffix}</syntaxhighlight>]] determines file name suffix a generated library
 
* [[$libPrefix and $libSuffix|<syntaxhighlight lang="pascal" enclose="none">{$libSuffix}</syntaxhighlight>]] determines file name suffix a generated library
* [[$S|<syntaxhighlight lang="pascal" enclose="none">{$S}</syntaxhighlight>]] creates code to check for stack overflows
 
 
* [[$memory|<syntaxhighlight lang="pascal" enclose="none">{$memory}</syntaxhighlight>]] determines size of memory to use
 
* [[$memory|<syntaxhighlight lang="pascal" enclose="none">{$memory}</syntaxhighlight>]] determines size of memory to use
 
* [[$pascalMainName|<syntaxhighlight lang="pascal" enclose="none">{$PascalMainName}</syntaxhighlight>]] determines name of entry point
 
* [[$pascalMainName|<syntaxhighlight lang="pascal" enclose="none">{$PascalMainName}</syntaxhighlight>]] determines name of entry point

Revision as of 16:04, 4 September 2019

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