1
0
mirror of https://github.com/golang/go synced 2024-11-22 00:24:41 -07:00

cgo: rename internal f to avoid conflict with possible C global named f

Fixes #1452.

R=r
CC=golang-dev
https://golang.org/cl/4023060
This commit is contained in:
Russ Cox 2011-02-02 18:53:03 -05:00
parent 8a2891fc56
commit 259a974292

View File

@ -288,7 +288,7 @@ func (p *Package) guessKinds(f *File) []*Name {
var b bytes.Buffer
b.WriteString(builtinProlog)
b.WriteString(f.Preamble)
b.WriteString("void f(void) {\n")
b.WriteString("void __cgo__f__(void) {\n")
b.WriteString("#line 0 \"cgo-test\"\n")
for i, n := range toSniff {
fmt.Fprintf(&b, "%s; enum { _cgo_enum_%d = %s }; /* cgo-test:%d */\n", n.C, i, n.C, i)