]> Cypherpunks repositories - gostls13.git/commit
cmd/cgo: bug fixes
authorRuss Cox <rsc@golang.org>
Sun, 19 Feb 2012 18:32:55 +0000 (13:32 -0500)
committerRuss Cox <rsc@golang.org>
Sun, 19 Feb 2012 18:32:55 +0000 (13:32 -0500)
commit1a0c8fe9bb4498024c82dcc9d1beeb3e60cfe5d8
tree01baa2fcb415ae1ea11e8a5ca3d3fcf01157a342
parent72fb81eeb6a58a781ccfd3092f3657bddaa8cae3
cmd/cgo: bug fixes

* disallow embedding of C type (Fixes issue 2552)
* detect 0-length array (Fixes issue 2806)
* use typedefs when possible, to avoid attribute((unavailable)) (Fixes issue 2888)
* print Go types constructed from C types using original C types (Fixes issue 2612)

This fix changes _cgo_export.h to repeat the preamble from import "C".
Otherwise the fix to issue 2612 is impossible, since it cannot refer to
types that have not been defined.  If people are using //export and
putting non-header information in the preamble, they will need to
refactor their code.

R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/5672080
14 files changed:
doc/go1.html
doc/go1.tmpl
src/cmd/cgo/ast.go
src/cmd/cgo/doc.go
src/cmd/cgo/gcc.go
src/cmd/cgo/godefs.go
src/cmd/cgo/main.go
src/cmd/cgo/out.go
src/cmd/cgo/util.go
src/pkg/debug/dwarf/testdata/typedef.c
src/pkg/debug/dwarf/testdata/typedef.elf
src/pkg/debug/dwarf/testdata/typedef.macho
src/pkg/debug/dwarf/type.go
src/pkg/debug/dwarf/type_test.go