Subject:
[ruby-ffi] Re: cannot define function pointers that take function pointer arguments in jruby struct layout
From:
Andrea Fazzi
Date:
9/14/09 5:34 PM
To:
ruby-ffi


Excerpts from Aman Gupta's message of lun set 14 22:23:08 +0200 2009:

> JRuby supports it, just doesn't recognize the callback if its defined
> before the struct the way ffi-swig-generator does it. The issue is in
> FFI::Struct#find_type, but I got very confused trying to fix it.
> 
> If I nest the callback definition inline, it works as expected:
> 
>   class MyStruct < FFI::Struct
>     layout(
>       :member, callback([ callback([ :pointer ], :void) ], :void)
>     )
>   end
> 

I guess that Ruby-FFI and JRuby should expose the same behaviour in cases 
like these. Wayne, should we fire a JIRA ticket?

-- Andrea Fazzi @ alca.le.it Follow me on http://twitter.com/remogatto