summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-01-12 22:35:28 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-01-12 22:35:28 +0100
commit90198fa7ca83b41516ac5bea014ae0396a1d128f (patch)
tree2c52b458b22dcdf59282a2286d73c940022a24db /source4/pidl/lib/Parse
parent97ad5d5d80d0967c3ca7dbcd424883d3ad613138 (diff)
downloadsamba-90198fa7ca83b41516ac5bea014ae0396a1d128f.tar.gz
samba-90198fa7ca83b41516ac5bea014ae0396a1d128f.tar.bz2
samba-90198fa7ca83b41516ac5bea014ae0396a1d128f.zip
pidl: Prevent empty declarations for enums without body.
(This used to be commit c1e0570506d7c77112065a03a876cda4e4db7769)
Diffstat (limited to 'source4/pidl/lib/Parse')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/Header.pm18
1 files changed, 11 insertions, 7 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
index 7a6ffa46d6..9e27719d51 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
@@ -108,25 +108,28 @@ sub HeaderEnum($$)
my $first = 1;
pidl "#ifndef USE_UINT_ENUMS\n";
- pidl "enum $name {\n";
- $tab_depth++;
+ pidl "enum $name";
if (defined($enum->{ELEMENTS})) {
+ pidl " {\n";
+ $tab_depth++;
foreach my $e (@{$enum->{ELEMENTS}}) {
unless ($first) { pidl ",\n"; }
$first = 0;
pidl tabs();
pidl $e;
}
+ pidl "\n";
+ $tab_depth--;
+ pidl "}";
}
pidl "\n";
- $tab_depth--;
- pidl "}\n";
pidl "#else\n";
my $count = 0;
- pidl "enum $name { __donnot_use_enum_$name=0x7FFFFFFF}\n";
+ pidl "enum $name";
my $with_val = 0;
my $without_val = 0;
if (defined($enum->{ELEMENTS})) {
+ pidl " { __donnot_use_enum_$name=0x7FFFFFFF}";
foreach my $e (@{$enum->{ELEMENTS}}) {
my $t = "$e";
my $name;
@@ -144,9 +147,10 @@ sub HeaderEnum($$)
fatal($e->{ORIGINAL}, "you can't mix enum member with values and without values!")
unless ($with_val == 0);
}
- pidl "#define $name ( $value )\n";
+ pidl "\n#define $name ( $value )";
}
}
+ pidl "\n";
pidl "#endif\n";
}
@@ -215,7 +219,7 @@ sub HeaderType($$$)
sub HeaderTypedef($)
{
my($typedef) = shift;
- HeaderType($typedef, $typedef->{DATA}, $typedef->{NAME});
+ HeaderType($typedef, $typedef->{DATA}, $typedef->{NAME}) if defined ($typedef->{DATA});
}
#####################################################################