Sign in Join
Wiki copytemporary

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 .

Edited on wiki.freepascal.org by 17 people, 2004–2022

From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.

WhenWhoWhat changed
81.224.251.162Added list of differences beween FPC and the mac dialect
213.115.0.136Added newly implemented constructs
213.115.0.136
213.101.46.81More MacPas constructs added
157.193.206.33+ mention no support for goto between different nesting levels
157.193.206.33Added some notes regarding compilation under Mac OS X
221.198.73.159
131.155.228.51
MarcovPlanned (minor)
VincentFree Pascal constructs allowed in Mode MacPas (minor)
FPKReverted edit of 1145009963, changed back to last version by Olle (minor)
FPKReverted edit of 1146306733, changed back to last version by FPK (minor)
Mischitypo (minor)
Mischitypos (minor)
Adriaanuniv has been implemented in fpc 2.5.1 (minor)
AdriaanPOWERPC as equivalent of POWER in fpc 2.5.1 (minor)
AdriaanCompiler option $OV (+/-) sets overflow checking (minor)
MischiApple's Universal Interfaces: typo (minor)
AdriaanPlanned
AdriaanNot Supported
JwdietrichCategorization
Jwdietrich
Jwdietrich
JwdietrichLinks added.
JwdietrichCategorization
E-ric
WillbprogSpelling and minor grammar edits
TrevRationalised macOS categories (minor)
TrevApple's Universal Interfaces: Category update (minor)
FTurtleCategories moved to template
TrevLanguage: OSX -> macOS (minor)
Kai BurghardtFree Pascal constructs allowed in Mode MacPas: insert some links
Kai BurghardtFree Pascal constructs allowed in Mode MacPas: insert link to Assign (minor)

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.