Open
Description
Hi!
This is related to #1971 but not exactly the same. In my case, the unions and structs are named by their field, so it would be nice if bindgen could make use of that name.
Since I saw that the other issue was "help wanted" I spend some time trying to figure it out, but with all complex type parsing code I couldn't understand how to link the resolved type to the field name.
Input C/C++ Header
struct snd_ctl_event {
int type;
union {
struct {
unsigned int mask;
struct snd_ctl_elem_id id;
} elem;
unsigned char data8[60];
} data;
};
Actual Results
pub struct snd_ctl_event__bindgen_ty_1__bindgen_ty_1 {
pub mask: c_uint,
pub id: snd_ctl_elem_id,
}
pub union snd_ctl_event__bindgen_ty_1 {
pub elem: snd_ctl_event__bindgen_ty_1__bindgen_ty_1,
pub data8: [c_uchar; 60],
// some fields omitted
}
// etc
Expected Results
pub struct snd_ctl_event__data__elem {
pub mask: c_uint,
pub id: snd_ctl_elem_id,
}
pub union snd_ctl_event__data {
pub elem: snd_ctl_event__data__elem,
pub data8: [c_uchar; 60],
// some fields omitted
}
// etc