global compiler directives
From Lazarus wiki
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:
{$mode}
selects the compiler mode{$modeSwitch}
turns on or off specific mode features
Specific:
{$extendedSyntax}
enables multiple syntax extensions{$pointerMath}
automatically defines operators for new pointer data types (since FPC 2.6.0){$openStrings}
or{$P}
determines, whether all routine parameters of typestring
are considered to be open string parameters; this parameter only has effect for short strings, not forANSIString
s.{$varPropSetter}
Code generation
{$codePage}
determines which code page is used by the program{$E}
emulate co-processor{$extension}
determines file name suffix of the generated executable{$libPrefix}
determines file name prefix a generated library{$libSuffix}
determines file name suffix a generated library{$memory}
determines size of memory to use{$PascalMainName}
determines name of entry point{$PIC}
enables position independent code code generation{$smartlink}
determines smartlinking{$sysCalls}
determines system call calling conventions on Amiga/MorphOS
Data inclusion
{$debugInfo}
or{$D}
inserts GNU debugging information into generated code{$referenceInfo}
or{$Y}
creates Delphi-compatible browser information (not yet fully supported)
Paths
{$frameworkPath}
(on Darwin){$includePath}
determines path for include files{$libraryPath}
determines the path to library files{$objectPath}
defines the path to search for object files at{$unitPath}
determines search path for units
Target-dependent
Novell NetWare only
{$copyright}
inserts copyright information{$screenName}
determines screen name of application{$threadName}
defines name of thread
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
{$appType}
determines the program type
Compile-time data
{$profile}
enables generation of profile code
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 |