ochafik/nativelibs4java — Issue #231: Allocating StructObject fails
Author: finson
Created: 2012-01-11 20:47:02+00:00
State: open

I am using JNAerator and BridJ to create an interface to an existing library. When I execute this code:

```Pointer pRO = Pointer.allocate(cec_device_type_list.class);
```

I get this error:

```Unable to compute size of type org.bridj.ValuedEnum
```

I know there are some issues with structs, is this an expected failure? Is there a workaround or a mistake on my part that I can correct?

--------------------------------------------------

The class cec_device_type_list extends StructObject and includes these statements in the generated code:

```	/// C type : cec_device_type[5]
@Array({5})
@Field(0)
```

The enum cec_device_type implements IntValuedEnum and is based on this native code:

```typedef enum cec_device_type
{
CEC_DEVICE_TYPE_TV = 0,
[...snip...]
CEC_DEVICE_TYPE_AUDIO_SYSTEM = 5
} cec_device_type;
```