[fpc-pascal] Exportable compile time variables/macros added to $mode MacPas

Olle Raab olle.r at automagika.se
Mon Jan 10 00:06:24 CET 2005


Now macros/compile time variables defined in the interface part of a unit is
exported, in the same manner as ordinary pascal constructs, as in Metrowerks
pascal and Think Pascal.

Only a mode MacPas unit will export macros and only a mode MacPas unit will
import them. As before, MacPas and non-MacPas units can be used by each
other but macros will then not be visible for use.

Macros will start to be exported right after the {$MODE MACPAS} directive.
If no such directive is given, but -Mmacpas is given on the command line,
macros will start to be exported right after the UNIT keyword.

To support this, for a unit, {$MODE MACPAS} if forbidden after the UNIT
keyword. For other mode switches it is like before.

Caveat: If {$MODE MACPAS} is given before UNIT, the macros defined between
this point and UNIT is exported, if the unit is compiled as part of a
program or other unit, but is not exported if the unit is compiled from the
commandline (at top level). To be deterministic, do not put macros before
UNIT.

Olle





More information about the fpc-pascal mailing list