mescc: Respect integer literal type suffixes.

* module/mescc/compile.scm (ast->type): Respect ULL, UL, U, LL, L suffix
on integer literals.
This commit is contained in:
Jan (janneke) Nieuwenhuizen 2021-01-01 10:28:24 +01:00
parent 557c1d558a
commit 3607e8788e
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 8 additions and 1 deletions

View File

@ -116,7 +116,14 @@
((char ,value) (get-type "char" info))
((enum-ref . _) (get-type "default" info))
((fixed ,value) (get-type "default" info))
((fixed ,value)
(let ((type (cond ((string-suffix? "ULL"value) "unsigned long long")
((string-suffix? "UL" value) "unsigned long")
((string-suffix? "U" value) "unsigned")
((string-suffix? "LL" value) "long long")
((string-suffix? "L" value) "long")
(else "default"))))
(get-type type info)))
((float ,float) (get-type "float" info))
((void) (get-type "void" info))