cgo: add support for anonymous structs

This commit is contained in:
Ayke van Laethem
2019-06-02 16:22:27 +02:00
committed by Ron Evans
parent 1047c9bd05
commit 0ce4d90779
4 changed files with 125 additions and 83 deletions
+2 -1
View File
@@ -36,6 +36,7 @@ type cgoPackage struct {
typedefs map[string]*typedefInfo
elaboratedTypes map[string]*elaboratedTypeInfo
enums map[string]enumInfo
anonStructNum int
}
// constantInfo stores some information about a CGo constant found by libclang
@@ -68,7 +69,7 @@ type typedefInfo struct {
// elaboratedTypeInfo contains some information about an elaborated type
// (struct, union) found in the C AST.
type elaboratedTypeInfo struct {
typeExpr ast.Expr
typeExpr *ast.StructType
pos token.Pos
bitfields []bitfieldInfo
}