From 0d03fdb825a62b9bc62dc625297f56add787f309 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Tue, 5 Apr 2011 00:57:49 +1200 Subject: [PATCH] Propagate pre-processor directives from enum definition to strings definition This allows enum to contain conditional entries and build without them. --- src/mk-string-arrays.awk | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mk-string-arrays.awk b/src/mk-string-arrays.awk index 42133a3f5c..be0ebadf3a 100644 --- a/src/mk-string-arrays.awk +++ b/src/mk-string-arrays.awk @@ -37,6 +37,13 @@ codeSkip == 1 { next } next } +/^#/ { + if (codeSkip) next + + Wrapper[++e] = $0 + next +} + /^} / { split($2, t, ";") # remove ; type = t[1] @@ -50,7 +57,9 @@ codeSkip == 1 { next } print "\nconst char *" type "_str[] = {" for ( i = 1; i < e; ++i) - print "\t\"" Element[i] "\"," + if (Wrapper[i]) print Wrapper[i] + else print "\t\"" Element[i] "\"," + print "\t\"" Element[i] "\"" print "};" if (namespace) print "}; // namespace " namespace -- 2.47.3