define an empty lambda as an empty function

A lifted function with no body was a declaration of one, and nothing
defined it, so the program did not link.
This commit is contained in:
2026-10-18 22:02:55 +03:00
parent b3d7decc6b
commit 94f41b5fad
5 changed files with 45 additions and 10 deletions

View File

@@ -784,9 +784,12 @@
(c-type 'void)
(c-in-expr (fmt-join/dot c-param (lambda (dot) (dsp "...")) ls ", "))))
;; MODIFIED FROM UPSTREAM fmt-c: a function of no statements is `{}'
(define (c-fun type name params . body)
(cat (c-block (c-in-expr (c-prototype type name params))
(c-in-stmt (apply c-begin body)))
(cat (if (null? body)
(c-braced-block (c-in-expr (c-prototype type name params)))
(c-block (c-in-expr (c-prototype type name params))
(c-in-stmt (apply c-begin body))))
fl))
;; MODIFIED FROM UPSTREAM fmt-c: the name and parameters are the