diff --git a/src/cmd/cgo/doc.go b/src/cmd/cgo/doc.go index f82d78205582521e6d49bb3452fcd0f464381558..723bbfe6ad55c7f88539c3acd7f64a1ec2c78a5b 100644 --- a/src/cmd/cgo/doc.go +++ b/src/cmd/cgo/doc.go @@ -119,6 +119,7 @@ C.short, C.ushort (unsigned short), C.int, C.uint (unsigned int), C.long, C.ulong (unsigned long), C.longlong (long long), C.ulonglong (unsigned long long), C.float, C.double. The C type void* is represented by Go's unsafe.Pointer. +The C types __int128_t and __uint128_t are represented by [16]byte. To access a struct, union, or enum type directly, prefix it with struct_, union_, or enum_, as in C.struct_stat. diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index b65b6cb7a954de0d7360ed52cb3d6eebac34cc64..198c05452f372253a26ee5c3c4c9dc622d4603d9 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -1227,6 +1227,11 @@ func (c *typeConv) Type(dtype dwarf.Type, pos token.Pos) *Type { t.Go = c.int32 case 8: t.Go = c.int64 + case 16: + t.Go = &ast.ArrayType{ + Len: c.intExpr(t.Size), + Elt: c.uint8, + } } if t.Align = t.Size; t.Align >= c.ptrSize { t.Align = c.ptrSize @@ -1384,6 +1389,11 @@ func (c *typeConv) Type(dtype dwarf.Type, pos token.Pos) *Type { t.Go = c.uint32 case 8: t.Go = c.uint64 + case 16: + t.Go = &ast.ArrayType{ + Len: c.intExpr(t.Size), + Elt: c.uint8, + } } if t.Align = t.Size; t.Align >= c.ptrSize { t.Align = c.ptrSize