aboutsummaryrefslogtreecommitdiff
path: root/tcctok.h
diff options
context:
space:
mode:
authorMatthias Gatto <uso.cosmo.ray@gmail.com>2016-12-09 11:42:41 +0100
committerMatthias Gatto <uso.cosmo.ray@gmail.com>2017-07-05 10:57:50 +0200
commit157bad52cdb052015f64a29e47099b2470f67c3e (patch)
tree0f63feb00ba8a13813180cbef159edf3b026cef4 /tcctok.h
parent9ed8b54f6cd2ebf1d5dc678ab2296e92ad85cd3e (diff)
downloadtinycc-157bad52cdb052015f64a29e47099b2470f67c3e.tar.gz
tinycc-157bad52cdb052015f64a29e47099b2470f67c3e.tar.bz2
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.
Diffstat (limited to 'tcctok.h')
-rw-r--r--tcctok.h4
1 files changed, 3 insertions, 1 deletions
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")