On 10 February 2012 13:14, Javier Pimás <elpochodelagente@gmail.com> wrote:
I have this wrapper:
chooseVisual: display screen: aScreenNumber attributes: attribList <primitive: #primitiveNativeCall module: #NativeBoostPlugin>
^ self call: #( NBXLibVisualInfo* glXChooseVisual ( NBXLibDisplay display , int aScreenNumber, int *attribList ) )
but when generating native code it ends in:
ExternalStructureType>>coerceReturn: gen
" ... should we support handling return of external structures? " self error: 'returning pointer to structure?'
Changing "NBXLibVisualInfo*" to "NBXLibVisualInfo" didn't help. Is there any workaround??
Yes. Change the return type to void* :) And then do as i showed before: load the struct fields from that pointer in your code. info := NBXLibVisualInfo fromPointer: (self chooseVisual: display screen: aScreenNumber attributes: attribList) Because how you would implement it? It maybe a pointer to single structure or pointer to an array of structures.. Because in C a pointer can be a pointer to a single value, or pointer to multiple values and you cannot make a difference. -- Best regards, Igor Stasenko.