Adriaan van Os wrote:
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 ?
I wouldn't object (as long as the backend problem persists). Of course, you should point out this change in the accompanying documentation and distribute the "source" (i.e., a one liner patch, though you might want to add appropriate system conditionals, so it won't change anything if someone uses it on a system that doesn't need the workaround).
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 ?
For BP, there is the `System' unit which, if compiled with `-D__BP_TYPE_SIZES__' redefines types to their exact BP/Dos sizes. You could use a similar approach, or even add to this unit (which will make Integer 16 bit and LongInt 32 bit as well already).
-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.
I see.
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.
I don't have that reference handy, so I guess I should take that as a yes?
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 [...]
OK, looks compatible enough (in standard Pascal the items to be read are no `var' parameters, i.e. they can be packed fields, variant selectors and the types have to be only assignment-compatible, but since this only allows for more, I think it's ok).
Frank