1
0
forked from alex-eg/sex

generate void in empty argument lists

This commit is contained in:
2025-08-14 14:35:50 +03:00
committed by Pavel Kulyov
parent 103e95fcf7
commit c9848151d0

View File

@@ -626,7 +626,9 @@
(else (error "missing type" x)))) (else (error "missing type" x))))
(define (c-param-list ls) (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) (define (c-fun type name params . body)
(cat (c-block (c-in-expr (c-prototype type name params)) (cat (c-block (c-in-expr (c-prototype type name params))