Wiki copymirror

This is a mirror of the wiki at pascal.chat. Editing, history and sign-in are there.

Mode MacPas

English · Français

Mode MacPas tries to be compatible with the Pascal dialects commonly used on Macintosh, that is THINK Pascal, Metrowerks Pascal and MPW Pascal. For tips on porting from traditional Mac Pascal compiler to Free Pascal, see Porting from Mac Pascal

Differences compared to standard Free Pascal

Here differences between the Macintosh dialect of Pascal and the standard dialect of Free Pascal (which is Turbo Pascal) are listed.

Implemented (in 2.0.2)

Compile time constructs

Language

Implemented (in 2.1.1)

Planned

Not Supported

Here is an (incomplete) list of mac pascal constructs which are not supported in mode mac at the moment, perhaps some of them will be supported in the future:

Free Pascal constructs allowed in Mode MacPas

Free Pascal constructs which currently are allowed in Mode MacPas, but which actually are not in the Macintosh dialect. If conflicts arises, some of them might be disallowed in future. Traditionally some of this functionality has been offered through Apple's Universal Interfaces. The list is not complete.

Exportable macros

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 1: 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.

Caveat 2: Deviation from Think Pascal and Metrowerks Pascal: Macros from used units is not in effect until after the whole uses clause (incl semicolon) has been parsed.

Apple's Universal Interfaces

Starting with FPC 2.04, Apple's Universal interfaces are included with FPC. They are from the same source tree that is available at http://www.microbizz.nl/gpc.html, only a slightly more recent version (r165 as of 2.0.4).


From the Free Pascal wiki, page "Mode MacPas", as it stood on 2022-09-03 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .