mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-12 23:13:40 +00:00
cgo: add support for nested structs and unions
This commit is contained in:
committed by
Ron Evans
parent
6108ee6859
commit
b153bd63f2
Vendored
+25
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user