1
0
mirror of https://github.com/golang/go synced 2024-11-22 10:04:42 -07:00

cmd/cgo: fix windows build

The shared library changes broke the windows build because __attribute__ ((visibility ("hidden"))) is not supported in windows gcc. This change removes the attribute, as it is only needed when building shared libraries.

R=rsc
CC=golang-dev
https://golang.org/cl/12829044
This commit is contained in:
Elias Naur 2013-08-14 12:47:06 -04:00 committed by Russ Cox
parent 13c7896fb6
commit a5f257a042

View File

@ -494,7 +494,7 @@ func (p *Package) writeOutputFunc(fgcc *os.File, n *Name) {
// Gcc wrapper unpacks the C argument struct
// and calls the actual C function.
fmt.Fprintf(fgcc, "__attribute__ ((visibility (\"hidden\"))) void\n")
fmt.Fprintf(fgcc, "void\n")
fmt.Fprintf(fgcc, "_cgo%s%s(void *v)\n", cPrefix, n.Mangle)
fmt.Fprintf(fgcc, "{\n")
if n.AddError {