Re: [Pharo-users] Passing nil with FFI

2016-04-11 Thread Thibault Raffaillac
Great, that worked, thanks! > Hi, > > marshalling in UFFI is complex and sometimes not worthy, so we do not do > auto-conversion between nil in smalltalk o zero to NULL (yes, I know NULL=0, > but not for UFFI who is waiting a object type). > In this case (since it expects a kind of external objec

Re: [Pharo-users] Passing nil with FFI

2016-04-08 Thread Esteban Lorenzano
Hi, marshalling in UFFI is complex and sometimes not worthy, so we do not do auto-conversion between nil in smalltalk o zero to NULL (yes, I know NULL=0, but not for UFFI who is waiting a object type). In this case (since it expects a kind of external object) you have to do: SDL2 glCreateConte

[Pharo-users] Passing nil with FFI

2016-04-07 Thread Thibault Raffaillac
Hi, I am having trouble passing nil to a function with FFI (i.e. NULL, i.e. 0). For example: SDL2 glCreateContext: nil. The function expects a subclass of FFIExternalObject, so calls instVarAt: 1 but nil has no such field! Am I missing something? (like a special nil instance of FFIExternalObject)