generate void in empty argument lists

This commit is contained in:
2025-08-14 14:35:50 +03:00
parent 176844171c
commit adf845fe01

View File

@@ -626,7 +626,9 @@
(else (error "missing type" x))))
(define (c-param-list ls)
(c-in-expr (fmt-join/dot c-param (lambda (dot) (dsp "...")) ls ", ")))
(if (null? ls)
(c-type 'void)
(c-in-expr (fmt-join/dot c-param (lambda (dot) (dsp "...")) ls ", "))))
(define (c-fun type name params . body)
(cat (c-block (c-in-expr (c-prototype type name params))