FFI Questions

Raab, Andreas Andreas.Raab at disney.com
Wed Apr 12 02:09:45 UTC 2000


David,

The way you pass a null pointer is by using nil. The FFI does not allow to
pass an Integer for a pointer. Concerning 'void' - these declarations are
discarded by the Parser since the data size of 'void' is unknown. It is not
brought up as an error though for reasons of declaring something as 'void
myFunction(void)'.

  - Andreas

> -----Original Message-----
> From: Pennell, David [mailto:dpennell at quallaby.com]
> Sent: Tuesday, April 11, 2000 5:20 PM
> To: 'squeak at cs.uiuc.edu'
> Cc: recipient list not shown
> Subject: FFI Questions
> 
> 
> I have a DLL with a function declared:
> 
> (void) foo(unsigned int a, void *b)
> 
> I have a method:
> 
> fooA: a b: b
> <apicall: void 'foo' (ulong void*) module: 'mymodule'>
> ^self externalCallFailed
> 
> How do I pass a null pointer for b?
> 
> If I send:  fooA: 0 b: 0
> I get "Bad arguments in primitive invocation"
> 
> If I change the definition to:
> 
> <apicall: void 'foo' (ulong void) module: 'mymodule'>
> 
> and send the same message, I get the same result.
> 
> 
> -david





More information about the Squeak-dev mailing list