Ayke van Laethem
d2b3a5486c
cgo: implement C unions
...
Unions are somewhat hard to implement in Go because they are not a
native type. But it is actually possible with some compiler magic.
This commit inserts a special "C union" field at the start of a struct
to indicate that it is a union. As such a field cannot be written
directly in Go, this is a useful to distinguish structs and unions.
2019-04-17 11:56:40 +02:00
Ayke van Laethem
536086988c
cgo: implement Go arrays (constant arrays in C)
2019-04-17 11:56:40 +02:00
Ayke van Laethem
684543b7f1
cgo: implement struct types
...
Not complete: packed structs are treated as regular structs.
2019-04-17 11:56:40 +02:00
Ayke van Laethem
da345e8723
cgo: implement bool/float/complex types
2019-02-18 17:17:56 +01:00
Ayke van Laethem
95d895646a
loader/cgo: add support for function pointers
2019-02-08 13:19:02 +01:00
Ayke van Laethem
35fb594f8f
loader/cgo: add support for pointer types
2019-02-08 13:19:02 +01:00
Ayke
01f6aff422
loader: support global variables in CGo ( #173 )
...
Global variables (like functions) must be declared in the import "C" preamble and can then be used from Go.
2019-02-08 13:04:03 +01:00
Ayke van Laethem
6cacafb8dc
cgo: add package directory to header include paths
2018-12-10 15:38:03 +01:00
Ayke van Laethem
c6069476a7
cgo: do not rely on stdint.h to be available
2018-12-10 15:38:03 +01:00
Ayke van Laethem
0af7da9bff
cgo: add support for C.int, c.uint, etc
2018-12-10 15:38:02 +01:00
Ayke van Laethem
ecf6ffa62e
all: add bare-bones Cgo support
2018-12-10 15:38:02 +01:00