FFI Question

Bert Freudenberg bert at isg.cs.uni-magdeburg.de
Thu May 17 14:29:06 UTC 2001


On Thu, 17 May 2001, Stephen Pair wrote:

> With the latest FFI code, what is considered the best way to handle
> simple C typdefs such that you can use them in the "cdecl" pragmas?
> I see that ExternalType has a class var called AtomicTypes...should I
> add something directly to this dictionary?

IMO you shouldn't mess around with this at all.

> Is there a better way, or should I just use the base types that the
> typedefs represent?

The latter. This way, it's at least obvious what's going on. You still can
include the original signature as comment.

If you really insist on using typedefs, you might add a class method
that answers a dictionary mapping typedefs to basic types. It should be
fairly easy to hack the compiler to honor these (see
Parser>>externalType:).

-- Bert





More information about the Squeak-dev mailing list