From d57b4aa6f384eadc1c308f6896d0f36412745c04 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Fri, 1 Jan 2021 10:28:24 +0100 Subject: [PATCH] mescc: Respect integer literal type suffixes. * module/mescc/compile.scm (ast->type): Respect ULL, UL, U, LL, L suffix on integer literals. --- module/mescc/compile.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/module/mescc/compile.scm b/module/mescc/compile.scm index d4e2ecbf..c7bea6d5 100644 --- a/module/mescc/compile.scm +++ b/module/mescc/compile.scm @@ -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))