cgo: implement struct types

Not complete: packed structs are treated as regular structs.
This commit is contained in:
Ayke van Laethem
2019-04-11 14:03:08 +02:00
committed by Ron Evans
parent bd8e47af80
commit 684543b7f1
4 changed files with 73 additions and 4 deletions
+7
View File
@@ -5,6 +5,12 @@ int doCallback(int a, int b, binop_t cb);
typedef int * intPointer;
void store(int value, int *ptr);
typedef struct collection {
short s;
long l;
float f;
} collection_t;
// test globals
extern int global;
extern _Bool globalBool;
@@ -14,6 +20,7 @@ extern double globalDouble;
extern _Complex float globalComplexFloat;
extern _Complex double globalComplexDouble;
extern _Complex double globalComplexLongDouble;
extern collection_t globalStruct;
// test duplicate definitions
int add(int a, int b);