diff --git a/fmt-c-writer.scm b/fmt-c-writer.scm index 63039ff..aadac0e 100644 --- a/fmt-c-writer.scm +++ b/fmt-c-writer.scm @@ -120,10 +120,6 @@ forms, and what remains." ((|\||) 'bit-or) ((|\|\||) '%or) ((|\|=|) 'bit-or=) - ;; uh things we do for c89 compatibility - ((bool) 'int) - ((true) 1) - ((false) 0) (else (if (symbol? atom) (unkebabify atom) diff --git a/sexc.scm b/sexc.scm index 111e8f2..3bb54ae 100644 --- a/sexc.scm +++ b/sexc.scm @@ -176,6 +176,7 @@ status, which is ours to pass on." (define prelude '((include inttypes.h) + (include stdbool.h) (typedef u8 uint8-t) (typedef i8 int8-t) diff --git a/tests/basic.scm b/tests/basic.scm index 29fc1b3..3456f0b 100644 --- a/tests/basic.scm +++ b/tests/basic.scm @@ -31,10 +31,10 @@ (test 'vector-ref (atom-to-fmt-c 'ยค)) (test '%include (atom-to-fmt-c 'include)) - ;; c89 stuff - (test 'int (atom-to-fmt-c 'bool)) - (test 1 (atom-to-fmt-c 'true)) - (test 0 (atom-to-fmt-c 'false)) + ;; C99 onwards, true C spellings for bool + (test 'bool (atom-to-fmt-c 'bool)) + (test 'true (atom-to-fmt-c 'true)) + (test 'false (atom-to-fmt-c 'false)) ;; dot-access -> %. member-access directive (kebab-converted operands) (test '(%. a b) (walk-expr '(dot-access a b))) diff --git a/tests/fmt-c-writer.scm b/tests/fmt-c-writer.scm index ba103c1..663fca4 100644 --- a/tests/fmt-c-writer.scm +++ b/tests/fmt-c-writer.scm @@ -150,7 +150,7 @@ (test '(struct mega_kebab ((int a) ((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 ((a int) (dob (struct ((year int)