aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuim Muntal <quimmuntal@gmail.com>2021-01-14 21:29:49 +0100
committerDmitri Shuralyov <dmitshur@golang.org>2021-03-31 21:40:01 +0000
commit1373d92a75f70c62d74f9e4714cd17811f75c48b (patch)
tree713ddb444dc7ff4a45b1b3ff34653a03ba1545e5
parent82f9c6cac1bcc6bc80f17d1415ac3f62c0afa6c5 (diff)
downloadgo-1373d92a75f70c62d74f9e4714cd17811f75c48b.tar.gz
go-1373d92a75f70c62d74f9e4714cd17811f75c48b.zip
[release-branch.go1.15] 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(); Updates #43591. 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> Reviewed-on: https://go-review.googlesource.com/c/go/+/300694 Trust: Dmitri Shuralyov <dmitshur@golang.org> Trust: Emmanuel Odeke <emmanuel@orijtech.com> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
-rw-r--r--src/cmd/cgo/out.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go
index ee1c563495..be4f6ad2d5 100644
--- a/src/cmd/cgo/out.go
+++ b/src/cmd/cgo/out.go
@@ -963,9 +963,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"