From 259a974292e7d85d50d0273a530e0c068f410689 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 2 Feb 2011 18:53:03 -0500 Subject: [PATCH] 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 --- src/cmd/cgo/gcc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index cadc6fae90d..9754c1d5652 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -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)