[squeak-dev] Re: FFI to call Mac Carbon functions

Igor Stasenko siguctua at gmail.com
Fri May 20 08:09:13 UTC 2011


On 20 May 2011 02:26, Sean P. DeNigris <sean at clipperadams.com> wrote:
>
> Levente Uzonyi-2 wrote:
>>
>> You don't have to implement C structs which you won't use in Squeak, just
>> pass around various C functions. In this case you can declare them as
>> void* and their class will be ExternalData.
>>
>
> Thanks Levente. I tried the above with a Foundation function, with no
> success:
>
> After I put a link to the Foundation lib in the VM's Resources folder, I
> compiled:
>
> CarbonFunctions>>NSMakeRectWithX: xFloat y: yFloat w: widthFloat h: hFloat
>        &lt;apicall: void* 'NSMakeRect' (float float float float) module:
> 'Foundation'&gt;
>        ^self externalCallFailed
>
> DoIt:
> CarbonFunctions
>        NSMakeRectWithX: 0.0
>        y: 0.0
>        w: 100.0
>        h: 100.0.
>
> Error: Unable to find function address
>

Btw, make sure that the lib you are using is 32bit.

> Sean
>
> --
> View this message in context: http://forum.world.st/FFI-to-call-Mac-Carbon-functions-tp3507842p3537296.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>
>



-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list