commit 7a478aec26042f997aef88307a462746b25843bf parent 53f5e54c8544433dd56e80e483645ba42530b46c Author: Kyle Milz <kyle@windows.krwm.net> Date: Thu, 5 Jan 2017 20:41:50 -0800 use c++11 raw character literals to simplify stringize Diffstat:
M | stringize.pl | | | 12 | +++--------- |
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/stringize.pl b/stringize.pl @@ -1,9 +1,3 @@ -print "static const char *$ARGV[0] = "; -while (<STDIN>) { - $_ =~ s/\\/\\\\/g ; - $_ =~ s/"/\\"/g; - $_ =~ s/^/"/; - $_ =~ s/$/\\n"/; - print ; -} -print ";"; +print "static const char *$ARGV[0] = R\"("; +print while (<STDIN>); +print ")\";";