Make <menu>_NUM_CHOICES not an enum tag

Fixes lp:1580972
This commit is contained in:
Andrew Johnson
2016-05-12 15:05:18 -05:00
parent 3c8af4c571
commit e98a6bbafa

View File

@@ -62,10 +62,11 @@ sub toDeclaration {
my @choices = map {
sprintf " %-31s /* %s */", @{$_}[0], escapeCcomment(@{$_}[1]);
} $this->choices;
my $num = scalar @choices;
return "typedef enum {\n" .
join(",\n", @choices) .
",\n ${name}_NUM_CHOICES\n" .
"} $name;\n\n";
"\n} $name;\n" .
"#define ${name}_NUM_CHOICES $num\n\n";
}
sub toDefinition {