Skip to content

Commit

Permalink
codegen: Handle a few more cases, populate some mps structs
Browse files Browse the repository at this point in the history
  • Loading branch information
tmc committed Jun 22, 2024
1 parent a0f1afa commit a35a378
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions generate/codegen/gen_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ func (f *Function) WriteGoCallCode(currentModule *modules.Module, cw *CodeWriter
sb.WriteString(cw.IndentStr + fmt.Sprintf(" (*C.%s)(unsafe.Pointer(&%s))", tt.CName(), p.GoName()))
case *typing.IDType:
sb.WriteString(cw.IndentStr + fmt.Sprintf(" %s.Ptr()", p.GoName()))
case *typing.ClassType, *typing.ProtocolType:
sb.WriteString(cw.IndentStr + fmt.Sprintf(" unsafe.Pointer(&%s)", p.GoName()))
default:
sb.WriteString(cw.IndentStr + p.GoName())
}
Expand Down

0 comments on commit a35a378

Please sign in to comment.