use true bool, since we target c99 onwards

This commit is contained in:
2026-09-27 18:06:59 +03:00
parent 26e8e6c374
commit a9b00f2135
4 changed files with 6 additions and 9 deletions

View File

@@ -120,10 +120,6 @@ forms, and what remains."
((|\||) 'bit-or) ((|\||) 'bit-or)
((|\|\||) '%or) ((|\|\||) '%or)
((|\|=|) 'bit-or=) ((|\|=|) 'bit-or=)
;; uh things we do for c89 compatibility
((bool) 'int)
((true) 1)
((false) 0)
(else (else
(if (symbol? atom) (if (symbol? atom)
(unkebabify atom) (unkebabify atom)

View File

@@ -176,6 +176,7 @@ status, which is ours to pass on."
(define prelude (define prelude
'((include inttypes.h) '((include inttypes.h)
(include stdbool.h)
(typedef u8 uint8-t) (typedef u8 uint8-t)
(typedef i8 int8-t) (typedef i8 int8-t)

View File

@@ -31,10 +31,10 @@
(test 'vector-ref (atom-to-fmt-c '¤)) (test 'vector-ref (atom-to-fmt-c '¤))
(test '%include (atom-to-fmt-c 'include)) (test '%include (atom-to-fmt-c 'include))
;; c89 stuff ;; C99 onwards, true C spellings for bool
(test 'int (atom-to-fmt-c 'bool)) (test 'bool (atom-to-fmt-c 'bool))
(test 1 (atom-to-fmt-c 'true)) (test 'true (atom-to-fmt-c 'true))
(test 0 (atom-to-fmt-c 'false)) (test 'false (atom-to-fmt-c 'false))
;; dot-access -> %. member-access directive (kebab-converted operands) ;; dot-access -> %. member-access directive (kebab-converted operands)
(test '(%. a b) (walk-expr '(dot-access a b))) (test '(%. a b) (walk-expr '(dot-access a b)))

View File

@@ -150,7 +150,7 @@
(test (test
'(struct mega_kebab ((int a) '(struct mega_kebab ((int a)
((struct ((int year) (int month) (int day))) dob) ((struct ((int year) (int month) (int day))) dob)
((%fun int ((int) (%array int))) min))) ((%fun bool ((int) (%array int))) min)))
(walk-struct '(struct mega-kebab (walk-struct '(struct mega-kebab
((a int) ((a int)
(dob (struct ((year int) (dob (struct ((year int)