Difference between revisions of "local compiler directives"
From Free Pascal wiki
Jump to navigationJump to searchJwdietrich (talk | contribs) (Remaining paragraphs translated.) |
Jwdietrich (talk | contribs) (Links corrected.) |
||
Line 4: | Line 4: | ||
==Local compiler direvtives== | ==Local compiler direvtives== | ||
− | *[[sAlign | + | *[[sAlign|$A and $ALIGN]] determines the of alignment of data in records. |
− | *[[sA | + | *[[sA|$A1, $A2,$A4 and $A8]] determines the of alignment of data in records. Has the same effect as the directive $PACKRECORDS. |
− | *[[sBooleval | + | *[[sBooleval|$B or $BOOLEVAL]] enables short-cut evaluation of boolean values. |
− | *[[sAssertions | + | *[[sAssertions|$C or $ASSERTIONS]] supports debugging. |
− | *[[sBitpacking | + | *[[sBitpacking|$BITPACKING]] enables bit-wise packing of records. |
− | *[[sCalling | + | *[[sCalling|$CALLING]] determines calling-convention of routines. |
− | *[[sCheckpointer | + | *[[sCheckpointer|$CHECKPOINTER]] checks validity of pointers. |
− | *[[sCodealign | + | *[[sCodealign|$CODEALIGN]] determines the code-aligning in memory. |
− | *[[sCoperators | + | *[[sCoperators|$COPERATORS]] enables usage of operatores similar to conventions in the C language. |
− | *[[sDefine | + | *[[sDefine|$DEFINE or $DEFINEC]] enables definition of own symbols. |
− | *[[sExtendedsym | + | *[[sExtendedsym|$EXTENDEDSYM]] ignored by compiler. |
− | *[[sFar | + | *[[sFar|$F]] ignored by compiler. |
− | *[[sFputype | + | *[[sFputype|$FPUTYPE]] compiles according to FPU type |
− | *[[sGoto | + | *[[sGoto|$GOTO]] enables Goto and Label |
− | *[[sH | + | *[[sH|$H or $LONGSTRINGS]] determines string type for reserved word [[string]]. |
− | *[[sHppemit | + | *[[sHppemit|$HPPEMIT]] ignored by compiler. |
− | *[[sImplicitexeptions | + | *[[sImplicitexeptions|$IMPLICITEXCEPTIONS]] helps to avoid memory leaks. |
− | *[[sInline | + | *[[sInline|$INLINE]] copies procedures to the place, where they have been called from. |
− | *[[sInterfaces | + | *[[sInterfaces|$INTERFACES]] determines interface type. |
− | *[[sIochecks | + | *[[sIochecks|$I or $IOCHECKS]] enables checking of input/output. |
− | *[[sIncludefile | + | *[[sIncludefile|$I or $INCLUDE]] includes file in compilation. |
− | *[[sIncludecompilerinfo | + | *[[sIncludecompilerinfo|$I or $INCLUDE]] included certein compiler information. |
− | *[[sWritableconst | + | *[[sWritableconst|$J or $WRITEABLECONST]] enables run-time assigning of values to typed constants. |
− | *[[sLink | + | *[[sLink|$L or $LINK]] inserts object file during linking. |
− | *[[sLinklib | + | *[[sLinklib|$LINKLIB]] inserts library during linking. |
− | *[[sTypeinfo | + | *[[sTypeinfo|$M or $TYPEINFO]] creates RTTI |
− | *[[sMacro | + | *[[sMacro|$MACRO]] enables usage of macros. |
− | *[[sMinenumsize | + | *[[sMinenumsize|$MINENUMSIZE]] for Delphi-compatibility, see [[sPackenum|$PACKENUM or $Z]] |
− | *[[sMinfpconstprec | + | *[[sMinfpconstprec|$MINFPCONSTPREC]] sets minimum accuracy of floating point operations. |
− | *[[sNodefine | + | *[[sNodefine|$NODEFINE]] ignored by compiler. |
− | *[[sObjectchecks | + | *[[sObjectchecks|$OBJECTCHECKS]] checks usage of pointer to self. |
− | *[[sOptimization | + | *[[sOptimization|$OPTIMIZATION]] switches on certain optimizations. |
− | *[[sOutput_format | + | *[[sOutput_format|$OUTPUT_FORMAT]] determines output format of object file. |
− | *[[sPackenum | + | *[[sPackenum|$PACKENUM or $Z]] enables packing of compiler enumerations. |
− | *[[sPackrecords | + | *[[sPackrecords|$PACKRECORDS]] determines alignment of records in memory. |
− | *[[sPackset | + | *[[sPackset|$PACKSET]] determines packing of sets. |
− | *[[sPop | + | *[[sPop|$POP]] recreates saved compiler settings. |
− | *[[sPush | + | *[[sPush|$PUSH]] saves current compiler settings. |
− | *[[sOverflowchecks | + | *[[sOverflowchecks|$OVERFLOWCHECKS]] checkes integer variables for overflow. |
− | *[[sRangechecks | + | *[[sRangechecks|$R or $RANGECHECKS]] checks overflow of index in compound variables. |
− | *[[sResource | + | *[[sResource|$R or $RESOURCE]] inserts resource file. |
− | *[[sStatic | + | *[[sStatic|$STATIC]] enable usage of the reserved word static. |
− | *[[sTypedadress | + | *[[sTypedadress|$T or $TYPEDADDRESS]] determines, if the address operator @ delivers a typed or untyped pointer. |
− | *[[sUndef | + | *[[sUndef|$UNDEF]] undefines symbol. |
− | *[[sVarstringchecks | + | *[[sVarstringchecks|$V or $VARSTRINGCHECKS]] enables checking of assignments to string variables. |
− | *[[sStackframes | + | *[[sStackframes|$W or $STACKFRAMES]] determines conditions for the creation of stack frames. |
− | *[[sWait | + | *[[sWait|$WAIT]] waits with execution until the enter key has been pressed. |
==Conditional compilation== | ==Conditional compilation== | ||
− | *[[sElse | + | *[[sElse|$ELSE]] defines alternative path in conditional compilation. |
− | *[[sElseIf | + | *[[sElseIf|$ELSEIF]] defines alternative and new branch conditional compilation. |
− | *[[sEndif | + | *[[sEndif|$ENDIF]] defines end of conditional compilation. |
− | *[[sIf | + | *[[sIf|$IF]] Begin of conditional compilation. |
− | *[[sIfdef | + | *[[sIfdef|$IFDEF]] Begin of conditional compilation. |
− | *[[sIfndef | + | *[[sIfndef|$IFNDEF]] Begin of conditional compilation. |
− | *[[sIfopt | + | *[[sIfopt|$IFOPT]] Begin of conditional compilation. |
==Self-defined compiler warnings, messages and hints== | ==Self-defined compiler warnings, messages and hints== | ||
− | *[[sError | + | *[[sError|$ERROR]] display a self-defined error message. |
− | *[[sFatal | + | *[[sFatal|$FATAL]] display a self-defined fatal error message. |
− | *[[sHint | + | *[[sHint|$HINT]] displays a self-defined hint. |
− | *[[sHints | + | *[[sHints|$HINTS]] enables self-defined hints. |
− | *[[sInfo | + | *[[sInfo|$INFO]] display a self-defined information message. |
− | *[[sMessage | + | *[[sMessage|$MESSAGE]] creates a self-defined information message. |
− | *[[sNote | + | *[[sNote|$NOTE]] creates a self-defined note. |
− | *[[sNotes | + | *[[sNotes|$NOTES]] enables the creation of self-defined notes. |
− | *[[sStop | + | *[[sStop|$STOP]] display a self-defined fatal error message. |
− | *[[sWarning | + | *[[sWarning|$WARNING]] creates a self-defined warning. |
− | *[[sWarnings | + | *[[sWarnings|$WARNINGS]] enables self-defined warnings. |
==Local compiler direvtives for x86 processors only== | ==Local compiler direvtives for x86 processors only== | ||
− | *[[sAsmmode | + | *[[sAsmmode|$ASMMODE]] assembler mode. |
− | *[[sI386xxx | + | *[[sI386xxx|$I386_XXX]] determines the assembler format. |
− | *[[sMmx | + | *[[sMmx|$MMX]] enables optimizations for MMX processores. |
− | *[[sSaturation | + | *[[sSaturation|$SATURATION]] Enables saturation (protection from memory-overflow) for MMX processores. |
− | *[[sMaxfpuregisters | + | *[[sMaxfpuregisters|$MAXFPUREGISTERS]] determines the maximum number of floating-points registers to use. |
==Local compiler direvtives for Darwin-based operating systems only== | ==Local compiler direvtives for Darwin-based operating systems only== | ||
− | *[[sLinkframework | + | *[[sLinkframework|$LINKFRAMEWORK]] inserts Framework. |
==Local compiler direvtives for MacPas mode only== | ==Local compiler direvtives for MacPas mode only== | ||
The following directives are supported for compatibility with existing Pascal compilers for Mac OS: | The following directives are supported for compatibility with existing Pascal compilers for Mac OS: | ||
− | *[[sAlign | + | *[[sAlign|$A and $ALIGN]] determines the alignment of data in records. |
− | *[[sErrorc | + | *[[sErrorc|$ERRORC]] returns an error message. |
− | *[[sOv | + | *[[sOv|$Q or $OV]] monitor overflow of integer variables. |
==Symbols== | ==Symbols== | ||
− | *[[sDefinec | + | *[[sDefinec|$DEFINEC]] enables definition of own symbols. |
− | *[[sSetc | + | *[[sSetc|$SETC]] defines and assigns a symbol. |
− | *[[sUndefc | + | *[[sUndefc|$UNDEFC]] undefines and unassigns a symbol. |
− | |||
[[Category: Compiler directives]] | [[Category: Compiler directives]] |
Revision as of 14:57, 21 September 2013
│
Deutsch (de) │
English (en) │
français (fr) │
Local directives may be used more then once in a unit or program.
Local compiler direvtives
- $A and $ALIGN determines the of alignment of data in records.
- $A1, $A2,$A4 and $A8 determines the of alignment of data in records. Has the same effect as the directive $PACKRECORDS.
- $B or $BOOLEVAL enables short-cut evaluation of boolean values.
- $C or $ASSERTIONS supports debugging.
- $BITPACKING enables bit-wise packing of records.
- $CALLING determines calling-convention of routines.
- $CHECKPOINTER checks validity of pointers.
- $CODEALIGN determines the code-aligning in memory.
- $COPERATORS enables usage of operatores similar to conventions in the C language.
- $DEFINE or $DEFINEC enables definition of own symbols.
- $EXTENDEDSYM ignored by compiler.
- $F ignored by compiler.
- $FPUTYPE compiles according to FPU type
- $GOTO enables Goto and Label
- $H or $LONGSTRINGS determines string type for reserved word string.
- $HPPEMIT ignored by compiler.
- $IMPLICITEXCEPTIONS helps to avoid memory leaks.
- $INLINE copies procedures to the place, where they have been called from.
- $INTERFACES determines interface type.
- $I or $IOCHECKS enables checking of input/output.
- $I or $INCLUDE includes file in compilation.
- $I or $INCLUDE included certein compiler information.
- $J or $WRITEABLECONST enables run-time assigning of values to typed constants.
- $L or $LINK inserts object file during linking.
- $LINKLIB inserts library during linking.
- $M or $TYPEINFO creates RTTI
- $MACRO enables usage of macros.
- $MINENUMSIZE for Delphi-compatibility, see $PACKENUM or $Z
- $MINFPCONSTPREC sets minimum accuracy of floating point operations.
- $NODEFINE ignored by compiler.
- $OBJECTCHECKS checks usage of pointer to self.
- $OPTIMIZATION switches on certain optimizations.
- $OUTPUT_FORMAT determines output format of object file.
- $PACKENUM or $Z enables packing of compiler enumerations.
- $PACKRECORDS determines alignment of records in memory.
- $PACKSET determines packing of sets.
- $POP recreates saved compiler settings.
- $PUSH saves current compiler settings.
- $OVERFLOWCHECKS checkes integer variables for overflow.
- $R or $RANGECHECKS checks overflow of index in compound variables.
- $R or $RESOURCE inserts resource file.
- $STATIC enable usage of the reserved word static.
- $T or $TYPEDADDRESS determines, if the address operator @ delivers a typed or untyped pointer.
- $UNDEF undefines symbol.
- $V or $VARSTRINGCHECKS enables checking of assignments to string variables.
- $W or $STACKFRAMES determines conditions for the creation of stack frames.
- $WAIT waits with execution until the enter key has been pressed.
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
- $LINKFRAMEWORK inserts Framework.
Local compiler direvtives for MacPas mode only
The following directives are supported for compatibility with existing Pascal compilers for Mac OS:
- $A and $ALIGN determines the alignment of data in records.
- $ERRORC returns an error message.
- $Q or $OV monitor overflow of integer variables.