C codegen: escape '?' because C has trigraphs

This commit is contained in:
Araq
2017-02-27 16:16:14 +01:00
parent 386efb464b
commit e78bd69619

View File

@@ -532,7 +532,7 @@ var
proc toCChar*(c: char): string =
case c
of '\0'..'\x1F', '\x80'..'\xFF': result = '\\' & toOctal(c)
of '\'', '\"', '\\': result = '\\' & c
of '\'', '\"', '\\', '?': result = '\\' & c
else: result = $(c)
proc makeCString*(s: string): Rope =