diff options
author | Michael Forney <mforney@mforney.org> | 2021-09-17 21:30:15 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2021-10-20 14:42:42 -0700 |
commit | 77cc546cba247149a0beec7fae66521a61fdecfe (patch) | |
tree | 761f8d3be1381e19a0ac99df671b18e945f43175 /cc.h | |
parent | e7cbbfbd5a8c8fdbbec30e4b78d2e21ade637fad (diff) |
expr: Add support for wide string literals
Thanks to Nihal Jere for his initial patches implementing this
feature.
Fixes #35.
Diffstat (limited to 'cc.h')
-rw-r--r-- | cc.h | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -309,6 +309,15 @@ enum exprkind { EXPRTEMP, }; +struct stringlit { + size_t size; + union { + unsigned char *data; + uint_least16_t *data16; + uint_least32_t *data32; + }; +}; + struct expr { enum exprkind kind; /* whether this expression is an lvalue */ @@ -331,14 +340,7 @@ struct expr { int64_t i; double f; } constant; - struct { - union { - unsigned char *data; - uint_least16_t *data16; - uint_least32_t *data32; - }; - size_t size; - } string; + struct stringlit string; struct { struct expr *args; size_t nargs; @@ -474,6 +476,8 @@ extern struct scope filescope; /* expr */ +struct type *stringconcat(struct stringlit *, _Bool); + struct expr *expr(struct scope *); struct expr *assignexpr(struct scope *); struct expr *constexpr(struct scope *); |