forked from alex-eg/sex
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user