From 157bad52cdb052015f64a29e47099b2470f67c3e Mon Sep 17 00:00:00 2001 From: Matthias Gatto Date: Fri, 9 Dec 2016 11:42:41 +0100 Subject: add C11's _Generic Simple implementation, I'm not even sure to respect C standart here, but it should work with most use case. This add an case in unary(), and generate TokString depending of _Generic controlling exression, use begin_macro to "push" the generated TokString, then call unary() again before exiting the switch so the just add token are reevaluate again. --- tcctok.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tcctok.h') diff --git a/tcctok.h b/tcctok.h index 270c1ed..56e1ae3 100644 --- a/tcctok.h +++ b/tcctok.h @@ -36,7 +36,9 @@ DEF(TOK_RESTRICT2, "__restrict") DEF(TOK_RESTRICT3, "__restrict__") DEF(TOK_EXTENSION, "__extension__") /* gcc keyword */ - + + DEF(TOK_GENERIC, "_Generic") + DEF(TOK_FLOAT, "float") DEF(TOK_DOUBLE, "double") DEF(TOK_BOOL, "_Bool") -- cgit v1.3.1