Subject:
Re: [ruby-ffi] Using enums in InlineArray
From:
Wayne Meissner
Date:
12/6/10 2:21 PM
To:
ruby-ffi@googlegroups.com

It'll get fixed if you file a issue for it, but in the meantime,
you'll just have to use a primitive type in its place.



On 7 December 2010 02:52, edek <edek123456@gmail.com> wrote:
> Hi,
>
> in my project I've got complex structure, that contains an array of
> enums.
>
> So I define named enum type and pass it to my struct layout.
>
> This structure is referenced in another structure.
>
> When I read my structure, FFI automatically creates object of type
> FFI::Struct::InlineArray.
>
> Unfortunately, when I try to read its contents I got following error:
> `each': get not supported for FFI::Enum (ArgumentError)
>
> It works well when I switch type to :uint32 - I can read integers.
>
> Is there any way to use enums in this place? That would be obviously
> much more ellegant. If it is not supported yet, could you give me any
> advice where I can extend FFI's functionality in this matter?
>
> Thank you,
>
> Marcin