Frank Heckenbach wrote:
I'm applying most of your patch now, considering Waldek's previous comments.
Thanks. Would you object if I make --longjmp-all-nonlocal-labels a general compiler default in the distribution for Mac OS X ?
The following changes (predef.h) add new built-in identifiers:
+PREDEF_TYPE (UnsignedWord,short_unsigned_type_node, MAC_PASCAL) +PREDEF_TYPE (UnsignedLong,pascal_cardinal_type_node, MAC_PASCAL)
Actually a problem. In MW Pascal UnsignedWord has the same size as Integer (16-bit) and UnsignedLong has the same size as LongInt (32-bit). So, either size-compatibility with the same types in MW Pascal has to be dropped or size-compatibilty their unsigned equivalents in GPC. Any opinions ?
-PREDEF_ROUTINE (Flush, "-F", ER_IOCRITICAL, B_D_PASCAL) +PREDEF_ROUTINE (Flush, "-F", ER_IOCRITICAL, B_D_M_PASCAL) +PREDEF_ALIAS (PLFlush, Flush, "-F", ER_IOCRITICAL, MAC_PASCAL)
-PREDEF_ALIAS (FilePos, Position, "lF", ER_IOCRITICAL, B_D_PASCAL) +PREDEF_ALIAS (FilePos, Position, "lF", ER_IOCRITICAL, B_D_M_PASCAL) +PREDEF_ALIAS (PLFilePos, Position,"lF", ER_IOCRITICAL, MAC_PASCAL) +PREDEF_ALIAS (PLCrunch, Truncate, "-F", ER_IOCRITICAL, MAC_PASCAL)
Actually, the availability of these routines in MW Pascal depends on the value of a CodeWarrior MW Pascal "IO Mode" setting. However, since we don't want a --mac-pascal subswitch (as you mentioned), the pragmatic solution is to make them all available in the --mac-pascal dialect.
PREDEF_ROUTINE (ReadStr, "-x,|", 0, E_O_PASCAL) +PREDEF_ALIAS (ReadString, ReadStr, "-x,|", 0, MAC_PASCAL)
(Just so be sure: MP has both `Flush' and `PLFlush' which are equivalent, same for `FilePos' and `PLFilePos';
See the above comment and Chapter 7 of the MW Pascal Library Ref.
and `ReadString' is equivalent to Extended Pascal's `ReadStr', i.e. full `Read' compatible parameter list with a source string as first argument?)
At least an attempt was made in MW Pascal, the Library Ref reads
PROCEDURE ReadString( str : STRING; VAR v1; VAR v2; ...; VAR vn);
The ReadString procedure takes a character string as input, str, and stores the values into its parameters. ReadString interprets strings the same way the Read routine interprets file or console in- put.
STRING is an UCSD-Pascal string.
`ReadString' probably requires a few extra additions to predef.c (look for `p_ReadStr'), or did you test it without it already?
No, I will have a look.
All built-in identifiers should be listed in doc/en/reference.texi. Can you add the relevant parts (easiest by copying from the equivalent names, changing names (also in the demo programs if any) and dialect info, and adding cross-references on both sides, as well as in other relevant entries that reference the other equivalent name).
Will do so.
You might want to add test programs for some or all changes, but I won't insist on it.
It would be useful. Any volunteers ?
Regards,
Adriaan van Os