Difference between revisions of "local compiler directives"

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

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

Local compiler direvtives 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.