cgo: add support for nested structs and unions

This commit is contained in:
Ayke van Laethem
2019-11-07 20:25:51 +01:00
committed by Ron Evans
parent 6108ee6859
commit b153bd63f2
5 changed files with 87 additions and 12 deletions
+25
View File
@@ -43,6 +43,31 @@ typedef struct {
int z;
} point3d_t;
typedef struct {
int tag;
union {
int a;
int b;
} u;
} tagged_union_t;
typedef struct {
int x;
struct {
char red;
char green;
char blue;
} color;
} nested_struct_t;
typedef union {
int x;
struct {
char a;
char b;
};
} nested_union_t;
// linked list
typedef struct list_t {
int n;