floor the C target at C11

f5eee71 spelled the closure environment in C99 for a floor nobody meant
to keep: closures were already C11 through _Static_assert. max_align_t
says the alignment in one word again, and the floor test now holds C11.
This commit is contained in:
2026-10-08 11:09:42 +03:00
parent dd3a4bdac5
commit 6c8b38b7e2
4 changed files with 44 additions and 39 deletions

View File

@@ -1182,19 +1182,13 @@
(define +closure-env-bytes+ 16)
;;; +closure-env-bytes+ for capacity, the widest built-ins for
;;; alignment, hence union -- a union takes the strictest alignment of
;;; its members. `max_align_t' would say the second in one word:
;;;
;;; sexc hello-world.sex -- -std=c99 unknown type name 'max_align_t'
;;; +closure-env-bytes+ for capacity, max_align_t for alignment, hence
;;; union -- a union takes the strictest alignment of its members.
(define +closure-env-type+ 'ƛenv)
(define (closure-env-declaration)
`(union ,+closure-env-type+ ((bytes (¤ char ,+closure-env-bytes+))
(align-integer (long long))
(align-real (long double))
(align-pointer (* void))
(align-code (fn ((* void)) void)))))
`(union ,+closure-env-type+ ((align max-align-t)
(bytes (¤ char ,+closure-env-bytes+)))))
(define +closure-structs+ (make-hash-table))
(define +closure-forwards+ (make-hash-table))