cgo working on linux/386

R=r
DELTA=70  (47 added, 4 deleted, 19 changed)
OCL=35167
CL=35171
This commit is contained in:
Russ Cox 2009-09-30 13:47:15 -07:00
parent 0632bb4ae5
commit e67a5084b8
10 changed files with 66 additions and 23 deletions

View file

@ -100,8 +100,8 @@ func (p *Prog) writeOutput(srcfile string) {
structType += fmt.Sprintf("\t\t%s p%d;\n", t.C, i);
off += t.Size;
}
if off%ptrSize != 0 {
pad := ptrSize - off%ptrSize;
if off%p.PtrSize != 0 {
pad := p.PtrSize - off%p.PtrSize;
structType += fmt.Sprintf("\t\tchar __pad%d[%d];\n", npad, pad);
off += pad;
npad++;
@ -116,8 +116,8 @@ func (p *Prog) writeOutput(srcfile string) {
structType += fmt.Sprintf("\t\t%s r;\n", t.C);
off += t.Size;
}
if off%ptrSize != 0 {
pad := ptrSize - off%ptrSize;
if off%p.PtrSize != 0 {
pad := p.PtrSize - off%p.PtrSize;
structType += fmt.Sprintf("\t\tchar __pad%d[%d];\n", npad, pad);
off += pad;
npad++;