Add a skeleton of an adler.update method.

This commit is contained in:
Nigel Tao committed 2017-10-19 18:58:17 +11:00
1 parent 5b0d6f6f3e
commit 50369c782c
5 files changed
+38 -2

No files matched your search

+8 -1
View File
@@ -61,8 +61,15 @@ func (g *gen) writeFuncSignature(b *buffer, n *a.Func) error {
// TODO: write n's return values.
if n.Suspendible() {
b.printf("%sstatus ", g.pkgPrefix)
} else {
} else if outFields := n.Out().Fields(); len(outFields) == 0 {
b.writes("void ")
} else if len(outFields) == 1 {
// TODO: does this generate the right C if the XType is an array?
if err := g.writeCTypeName(b, outFields[0].Field().XType(), "", ""); err != nil {
return err
}
} else {
return fmt.Errorf("TODO: multiple return values")
}
b.writes(g.pkgPrefix)