[Prev][Next][Index][Thread]

Re: PowerMacMindy & Toolbox wrappers




One potential red herring: the pascal keyword shouldn't affect PowerPC
function-call and parameter passing conventions, as everything on PowerPC uses
exactly the same calling conventions. They were different for different versions
of c and pascal on the 68k....

- Rob.

Gareth Baker wrote:

> Hi,
>
> I'm trying to get some of the basic Apple sample programs like Sillyballs to
> work under PowerMacMindy.
>
> I've actually got Sillyballs running but I have to comment out the test for
> the version of Quickdraw (YES I know that PowerMacMindy only works on
> machines that would pass the test but its a good 'exercise for the
> reader'!). I'm being a good boy and replacing the call to SysEnvirons by a
> call to Gestalt but the call is failing.
>
> The definition of Gestalt in the Universal Headers is:
>
> extern pascal OSErr Gesalt ( OSType selector, long * response);
>
> and my mindy wrapper code is:
>
> define constant $longPtr = NewPtr(4);
> define constant *InterfaceLib* = load-object-file(#("InterfaceLib"));
> define constant Gestalt =
> begin
>     let func = get-c-function("Gestalt", args: list(<OSType>, <Ptr>),
> result: <OSErr>, file: *InterfaceLib*);
>     method (selector :: <OSType>) => (ret :: <OSErr>, response: <integer>);
>         let result :: <OSErr> = func(selector, $longPtr);
>         values (result, signed-long-at($longPtr));
>     end method
> end;
>
> If anyone can shed light on why its failing I would be very grateful ( its
> giving an OSErr of -5551 and a response of 0).
>
> Thanks
> Gareth Baker
> G.J.Baker@dl.ac.uk




References: