]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/cgo: add missing tab in exports for a result of void
authorLeonard Wang <wangdeyu0907@gmail.com>
Sat, 24 Jul 2021 14:17:21 +0000 (22:17 +0800)
committerMeng Zhuo <mzh@golangcn.org>
Thu, 16 Sep 2021 14:24:32 +0000 (14:24 +0000)
Change-Id: I45575afbad364c13b7179ebe3f3dfc4ed9671d2b
Reviewed-on: https://go-review.googlesource.com/c/go/+/336891
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Meng Zhuo <mzh@golangcn.org>
src/cmd/cgo/out.go

index ee989b95e5daa5bc9214980fa1a826b36985baa3..93cc0c6dc971feabcf40500287d0d4d79097de13 100644 (file)
@@ -1054,9 +1054,10 @@ func (p *Package) writeExports(fgo2, fm, fgcc, fgcch io.Writer) {
 
                fmt.Fprintf(fm, "void _cgoexp%s_%s(void* p){}\n", cPrefix, exp.ExpName)
 
+               fmt.Fprintf(fgo2, "\t")
+
                if gccResult != "void" {
                        // Write results back to frame.
-                       fmt.Fprintf(fgo2, "\t")
                        forFieldList(fntype.Results,
                                func(i int, aname string, atype ast.Expr) {
                                        if i > 0 {