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

Sean P. DeNigris sean at clipperadams.com
Fri May 20 00:26:46 UTC 2011


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
	<apicall: void* 'NSMakeRect' (float float float float) module:
'Foundation'>
	^self externalCallFailed

DoIt:
CarbonFunctions
	NSMakeRectWithX: 0.0
	y: 0.0
	w: 100.0
	h: 100.0.

Error: Unable to find function address

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.



More information about the Squeak-dev mailing list