Error on unfulfilled cond-expand.

This complies with the SRFI 0 specification, and avoids the undefined
behavior of R7RS.
This commit is contained in:
Antero Mejr 2025-01-17 22:39:55 -05:00
parent a844854536
commit 7b9b7d0e67
3 changed files with 5 additions and 3 deletions

View file

@ -4,4 +4,5 @@
(define-c void (eval-script! "emscripten_run_script") (string))
(define-c int (integer-eval-script "emscripten_run_script_int") (string))
(define-c string (string-eval-script "emscripten_run_script_string") (string))))
(define-c string (string-eval-script "emscripten_run_script_string") (string)))
(else))

View file

@ -382,7 +382,7 @@
(memq (identifier->symbol x) *features*)))
(let expand ((ls (cdr expr)))
(cond
((null? ls)) ; (error "cond-expand: no expansions" expr)
((null? ls) (error "cond-expand: no expansions" expr))
((not (pair? (car ls))) (error "cond-expand: bad clause" (car ls)))
((eq? 'else (identifier->symbol (caar ls)))
(if (pair? (cdr ls))

View file

@ -171,7 +171,8 @@ double sexp_compute_least_double(double f) {
(define-c double (flgamma "tgamma") (double))
(cond-expand
(windows
(c-include-verbatim "lgamma_r.c")))
(c-include-verbatim "lgamma_r.c"))
(else))
(define-c double lgamma_r (double (result int)))
(define-c double (flfirst-bessel "jn") (int double))