]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/cgo: add a missing newline in writeExports
authorIan Lance Taylor <iant@golang.org>
Wed, 4 Nov 2015 01:18:42 +0000 (17:18 -0800)
committerIan Lance Taylor <iant@golang.org>
Wed, 4 Nov 2015 01:38:09 +0000 (01:38 +0000)
The code works without the newline, but it looks funny:

func _cgoexp_15afe6549f62_GoFn(a unsafe.Pointer, n int32) { fn := GoFn

This adds a newline after the '{'.

Change-Id: I6c465abe16f47924426d1b22b91004b3a3586ebd
Reviewed-on: https://go-review.googlesource.com/16612
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/cgo/out.go

index b69f410d155c10f6481cfb082bc507c1a7beb2a7..86184e5df42fa5e3086f520bc9c8a8b142973335 100644 (file)
@@ -814,7 +814,7 @@ func (p *Package) writeExports(fgo2, fm, fgcc, fgcch io.Writer) {
                fmt.Fprintf(fgo2, "//go:cgo_export_static _cgoexp%s_%s\n", cPrefix, exp.ExpName)
                fmt.Fprintf(fgo2, "//go:nosplit\n") // no split stack, so no use of m or g
                fmt.Fprintf(fgo2, "//go:norace\n")  // must not have race detector calls inserted
-               fmt.Fprintf(fgo2, "func _cgoexp%s_%s(a unsafe.Pointer, n int32) {", cPrefix, exp.ExpName)
+               fmt.Fprintf(fgo2, "func _cgoexp%s_%s(a unsafe.Pointer, n int32) {\n", cPrefix, exp.ExpName)
                fmt.Fprintf(fgo2, "\tfn := %s\n", goname)
                // The indirect here is converting from a Go function pointer to a C function pointer.
                fmt.Fprintf(fgo2, "\t_cgo_runtime_cgocallback(**(**unsafe.Pointer)(unsafe.Pointer(&fn)), a, uintptr(n));\n")