Skip to content

Commit 1373d92

Browse files
qmuntaldmitshur
authored andcommitted
[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 <[email protected]> Trust: Katie Hockman <[email protected]> Reviewed-on: https://go-review.googlesource.com/c/go/+/300694 Trust: Dmitri Shuralyov <[email protected]> Trust: Emmanuel Odeke <[email protected]> Run-TryBot: Dmitri Shuralyov <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: David Chase <[email protected]>
1 parent 82f9c6c commit 1373d92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cmd/cgo/out.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -963,9 +963,9 @@ func (p *Package) writeExports(fgo2, fm, fgcc, fgcch io.Writer) {
963963
// Build the wrapper function compiled by gcc.
964964
gccExport := ""
965965
if goos == "windows" {
966-
gccExport = "__declspec(dllexport)"
966+
gccExport = "__declspec(dllexport) "
967967
}
968-
s := fmt.Sprintf("%s %s %s(", gccExport, gccResult, exp.ExpName)
968+
s := fmt.Sprintf("%s%s %s(", gccExport, gccResult, exp.ExpName)
969969
if fn.Recv != nil {
970970
s += p.cgoType(fn.Recv.List[0].Type).C.String()
971971
s += " recv"

0 commit comments

Comments
 (0)