mirror of
https://github.com/golang/go
synced 2024-11-22 05:24:39 -07:00
cgo: add missing semicolon in generated struct
This affected certain signatures needing padding like: //export Foo func Foo() (int, C.long) { ... } R=golang-dev, rsc CC=golang-dev https://golang.org/cl/4745047
This commit is contained in:
parent
c945d9c8a1
commit
e8689404a7
@ -11,6 +11,7 @@ CGOFILES=\
|
|||||||
basic.go\
|
basic.go\
|
||||||
callback.go\
|
callback.go\
|
||||||
env.go\
|
env.go\
|
||||||
|
exports.go\
|
||||||
issue1222.go\
|
issue1222.go\
|
||||||
issue1328.go\
|
issue1328.go\
|
||||||
issue1560.go\
|
issue1560.go\
|
||||||
|
12
misc/cgo/test/exports.go
Normal file
12
misc/cgo/test/exports.go
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
// Copyright 2011 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package cgotest
|
||||||
|
|
||||||
|
import "C"
|
||||||
|
|
||||||
|
//export ReturnIntLong
|
||||||
|
func ReturnIntLong() (int, C.long) {
|
||||||
|
return 1, 2
|
||||||
|
}
|
@ -412,7 +412,7 @@ func (p *Package) writeExports(fgo2, fc, fm *os.File) {
|
|||||||
t := p.cgoType(atype)
|
t := p.cgoType(atype)
|
||||||
if off%t.Align != 0 {
|
if off%t.Align != 0 {
|
||||||
pad := t.Align - off%t.Align
|
pad := t.Align - off%t.Align
|
||||||
ctype += fmt.Sprintf("\t\tchar __pad%d[%d]\n", npad, pad)
|
ctype += fmt.Sprintf("\t\tchar __pad%d[%d];\n", npad, pad)
|
||||||
off += pad
|
off += pad
|
||||||
npad++
|
npad++
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user