mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/cgo: prepare for 64-bit ints
This CL makes the size of an int controlled by a variable in cgo instead of hard-coding 4 (or 32 bits) in various places. Update #2188. R=iant, r, dave CC=golang-dev https://golang.org/cl/6548061
This commit is contained in:
parent
0a006b4923
commit
5501a097a9
3 changed files with 38 additions and 11 deletions
|
|
@ -601,7 +601,7 @@ func (p *Package) loadDWARF(f *File, names []*Name) {
|
|||
|
||||
// Record types and typedef information.
|
||||
var conv typeConv
|
||||
conv.Init(p.PtrSize)
|
||||
conv.Init(p.PtrSize, p.IntSize)
|
||||
for i, n := range names {
|
||||
if types[i] == nil {
|
||||
continue
|
||||
|
|
@ -928,14 +928,16 @@ type typeConv struct {
|
|||
string ast.Expr
|
||||
|
||||
ptrSize int64
|
||||
intSize int64
|
||||
}
|
||||
|
||||
var tagGen int
|
||||
var typedef = make(map[string]*Type)
|
||||
var goIdent = make(map[string]*ast.Ident)
|
||||
|
||||
func (c *typeConv) Init(ptrSize int64) {
|
||||
func (c *typeConv) Init(ptrSize, intSize int64) {
|
||||
c.ptrSize = ptrSize
|
||||
c.intSize = intSize
|
||||
c.m = make(map[dwarf.Type]*Type)
|
||||
c.bool = c.Ident("bool")
|
||||
c.byte = c.Ident("byte")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue