Merge pull request #281 from ivan4th/master
CFFI: handle array struct/union members. I don't know how to test this, but merging anyway.
This commit is contained in:
commit
439313c7f4
1 changed files with 6 additions and 1 deletions
|
|
@ -831,7 +831,12 @@ void CFFI::emit_struct_union(Node *n, bool un = false) {
|
||||||
if (slot_name && (Strcmp(slot_name, "t") == 0 || Strcmp(slot_name, "T") == 0))
|
if (slot_name && (Strcmp(slot_name, "t") == 0 || Strcmp(slot_name, "T") == 0))
|
||||||
slot_name = NewStringf("t_var");
|
slot_name = NewStringf("t_var");
|
||||||
|
|
||||||
Printf(f_cl, "\n\t(%s %s)", slot_name, typespec);
|
if (SwigType_isarray(childType) && SwigType_array_ndim(childType) == 1) {
|
||||||
|
String *dim = SwigType_array_getdim(childType, 0);
|
||||||
|
Printf(f_cl, "\n\t(%s %s :count %s)", slot_name, typespec, dim);
|
||||||
|
Delete(dim);
|
||||||
|
} else
|
||||||
|
Printf(f_cl, "\n\t(%s %s)", slot_name, typespec);
|
||||||
|
|
||||||
Delete(node);
|
Delete(node);
|
||||||
Delete(childType);
|
Delete(childType);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue