1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: do not use L'x' for ASCII values (enable compilation with simpler C compilers)

This commit is contained in:
Delyan Angelov
2021-05-15 10:36:26 +03:00
parent 9fa805cbbf
commit 1305ca662f

View File

@@ -3100,7 +3100,11 @@ fn (mut g Gen) expr(node ast.Expr) {
if node.val == r'\`' {
g.write("'`'")
} else {
g.write("L'$node.val'")
if utf8_str_len(node.val) < node.val.len {
g.write("L'$node.val'")
} else {
g.write("'$node.val'")
}
}
}
ast.DumpExpr {