diff options
| author | Quim Muntal <quimmuntal@gmail.com> | 2021-01-14 21:29:49 +0100 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2021-01-14 21:49:46 +0000 |
| commit | 84e8a06f62e47bf3f126e6c7e5f39dd7ca82f421 (patch) | |
| tree | caae2528cfea127646f033f73839d2ce8aa57302 /src/cmd/cgo | |
| parent | 0c86b999c35ed199bc7aa001affb1d5d186c9e73 (diff) | |
| download | go-84e8a06f62e47bf3f126e6c7e5f39dd7ca82f421.tar.xz | |
cmd/cgo: remove unnecessary space in cgo export header
The cgo header has an unnecessary space in the exported function
definition on non-windows goos.
This was introduced in go1.16 so it would be good to fix it before
release.
Example:
// Current behavior, notice there is an unecessary space
// between extern and void
extern void Foo();
// With this CL
extern void Foo();
Change-Id: Ic2c21f8d806fe35a7be7183dbfe35ac605b6e4f6
Reviewed-on: https://go-review.googlesource.com/c/go/+/283892
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Katie Hockman <katie@golang.org>
Diffstat (limited to 'src/cmd/cgo')
| -rw-r--r-- | src/cmd/cgo/out.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go index 11c53facf8..fa6f0efbbe 100644 --- a/src/cmd/cgo/out.go +++ b/src/cmd/cgo/out.go @@ -953,9 +953,9 @@ func (p *Package) writeExports(fgo2, fm, fgcc, fgcch io.Writer) { // Build the wrapper function compiled by gcc. gccExport := "" if goos == "windows" { - gccExport = "__declspec(dllexport)" + gccExport = "__declspec(dllexport) " } - s := fmt.Sprintf("%s %s %s(", gccExport, gccResult, exp.ExpName) + s := fmt.Sprintf("%s%s %s(", gccExport, gccResult, exp.ExpName) if fn.Recv != nil { s += p.cgoType(fn.Recv.List[0].Type).C.String() s += " recv" |
