Commit b6371350 authored by Shenghou Ma's avatar Shenghou Ma

cmd/cgo: makes clang happy by not using __gcc_struct__ attribute.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/10150043
parent 46e30c7d
...@@ -488,7 +488,7 @@ func (p *Package) writeOutputFunc(fgcc *os.File, n *Name) { ...@@ -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, // Use __gcc_struct__ to work around http://gcc.gnu.org/PR52991 on x86,
// and http://golang.org/issue/5603. // and http://golang.org/issue/5603.
extraAttr := "" extraAttr := ""
if goarch == "amd64" || goarch == "386" { if !strings.Contains(p.gccName(), "clang") && (goarch == "amd64" || goarch == "386") {
extraAttr = ", __gcc_struct__" extraAttr = ", __gcc_struct__"
} }
fmt.Fprintf(fgcc, "\t%s __attribute__((__packed__%v)) *a = v;\n", ctype, extraAttr) fmt.Fprintf(fgcc, "\t%s __attribute__((__packed__%v)) *a = v;\n", ctype, extraAttr)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment