If we generate bindings for:
struct myStruct {
int x : 2;
};
And then compile the bindings, everything works.
If instead we generate bindings for:
typedef int myInt;
struct myStruct {
myInt y : 2;
};
Then we get a GHC error that roughly says:
• No instance for ‘HsBindgen.Runtime.Bitfield.Bitfield MyInt’
arising from a use of ‘HsBindgen.Runtime.HasCField.peekCBitfield’
It should be simple to derive a Bitfield instance because MyInt is just a newtype around CInt.
Alternatively, we can disallow bit-field types like myInt. The C reference section on bit-fields seems pretty restrictive about what types are allowed as bit-fields, but implementations like gcc and clang seem to be more flexible.