mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cgo: use C type void for opaque types if dwarf.Common().Type returns nothing
Ideally, the C name would come from the typedef or pointer that references the Size<0 type, but we can't easily generate this without performing a look-ahead to see if any referencing type will become opaque. Fixes #334. Fixes #281. R=rsc https://golang.org/cl/161056
This commit is contained in:
parent
f9f0184e13
commit
354b100567
1 changed files with 3 additions and 0 deletions
|
|
@ -320,6 +320,9 @@ func (c *typeConv) Type(dtype dwarf.Type) *Type {
|
|||
// Unsized types are [0]byte
|
||||
t.Size = 0;
|
||||
t.Go = c.Opaque(0);
|
||||
if t.C == "" {
|
||||
t.C = "void"
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue