summaryrefslogtreecommitdiffstats
path: root/mkenumsc.pl
diff options
context:
space:
mode:
Diffstat (limited to 'mkenumsc.pl')
-rw-r--r--mkenumsc.pl7
1 files changed, 6 insertions, 1 deletions
diff --git a/mkenumsc.pl b/mkenumsc.pl
index 5ea9829..0c5f6d9 100644
--- a/mkenumsc.pl
+++ b/mkenumsc.pl
@@ -20,6 +20,7 @@ use strict ; use warnings ;
print "/* Autogenerated from ",@ARGV," */\n" ;
print "#include \"enums.h\"\n" ;
+print "#define N_\n" ;
print "#include <stdio.h>\n" ;
while(<>) {
if( /^\s*typedef\s+enum\s/ ) {
@@ -73,11 +74,15 @@ while(<>) {
$_ = substr($_,0,-$suffix) for @desc{@nodesc} ;
nosuffix: ;
}
+ my $gettext = "" ;
+ if( $enum ne "PropType" ) {
+ $gettext = "N_" ;
+ }
my $buflen = 15 + length($enum);
print "const char*\nshow$enum($enum x)\n{\n" ;
print " static char buf[$buflen];\n switch(x) {\n" ;
for my $c (@all) {
- print " case $c: return \"$desc{$c}\";\n" ;
+ print " case $c: return $gettext(\"$desc{$c}\");\n" ;
}
print " default: sprintf(buf,\"($enum:%d)\",(int)x);\n" ;
print " return buf;\n }\n}\n";