From: Shenghou Ma Date: Mon, 10 Jun 2013 18:51:01 +0000 (+0800) Subject: cmd/cgo: makes clang happy by not using __gcc_struct__ attribute. X-Git-Tag: go1.2rc2~1289 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b637135003cd1b3dbc3cffe2c63752888713503d;p=gostls13.git cmd/cgo: makes clang happy by not using __gcc_struct__ attribute. R=golang-dev, iant CC=golang-dev https://golang.org/cl/10150043 --- diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go index eee71864cf..be05c85a2d 100644 --- a/src/cmd/cgo/out.go +++ b/src/cmd/cgo/out.go @@ -488,7 +488,7 @@ func (p *Package) writeOutputFunc(fgcc *os.File, n *Name) { // Use __gcc_struct__ to work around http://gcc.gnu.org/PR52991 on x86, // and http://golang.org/issue/5603. extraAttr := "" - if goarch == "amd64" || goarch == "386" { + if !strings.Contains(p.gccName(), "clang") && (goarch == "amd64" || goarch == "386") { extraAttr = ", __gcc_struct__" } fmt.Fprintf(fgcc, "\t%s __attribute__((__packed__%v)) *a = v;\n", ctype, extraAttr)