diff options
author | Ayke van Laethem <[email protected]> | 2019-04-20 02:39:31 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2019-04-20 10:18:38 +0200 |
commit | 21a4c14e86e5f30ff3c8ed509f6b2d0f408df08b (patch) | |
tree | c94c5898ee0295c5b9c55776a5c20d4b10df87d5 /testdata/cgo/main.h | |
parent | b716cf1afdb6365cbbeb4af974c27c916db36a9a (diff) | |
download | tinygo-21a4c14e86e5f30ff3c8ed509f6b2d0f408df08b.tar.gz tinygo-21a4c14e86e5f30ff3c8ed509f6b2d0f408df08b.zip |
cgo: implement C.struct_ types
These types (called elaborated types in C) are used as part of linked
lists, among others.
This is part an extra feature (to be compatible with CGo C.struct_
types) and part a bugfix: linked lists would result in endless recursion
leading to a stack overflow.
Diffstat (limited to 'testdata/cgo/main.h')
-rw-r--r-- | testdata/cgo/main.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/testdata/cgo/main.h b/testdata/cgo/main.h index 6330b223f..4cdf10ea3 100644 --- a/testdata/cgo/main.h +++ b/testdata/cgo/main.h @@ -12,6 +12,12 @@ typedef struct collection { unsigned char c; } collection_t; +// linked list +typedef struct list_t { + int n; + struct list_t *next; +} list_t; + typedef union joined { myint s; float f; |