1) Declare a class variable
MyClass class>>initialize INT_PTR := FFIExternalValueHolder ofType: ?int?.
as a larger explanation, this will create an anonymous subclass to keep ?int? values, than later you can use as a type in your function call. Some people would call this obscure, but is a good way of solving this problem (I adopted it from old NB). If you want to have a named class instead an anonymous class, you can just subclass FFIExternalValueHolder:
FFIExternalValueHolder subclass: #MyIntPtr
and then implement typeDecl class method
MyIntPtr class>>typeDecl ^ ?int'
and this will work as the anonymous class
The second option is definitely what I want. I am trying to expose a function returning several ints, as in SDL2>>mouseStateX: y: (excluding the possibility to return a Point). However I would rather not define my own int holder, can't we have generic holders to rely on? Thibault