summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-08-16 13:34:54 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:01:59 -0500
commite3162d376cf5eb7086f8398c347420b077a2202a (patch)
treeb0e9f8b563d97a463600f003a2d4f7ca470cc535 /source4/pidl/lib/Parse/Pidl
parent53cd0b017a559ba11dcb3f6193858bba81165390 (diff)
downloadsamba-e3162d376cf5eb7086f8398c347420b077a2202a.tar.gz
samba-e3162d376cf5eb7086f8398c347420b077a2202a.tar.bz2
samba-e3162d376cf5eb7086f8398c347420b077a2202a.zip
r24489: only typedef enum { ... } foo; enum's should look
for has_properties() of $enum->{PARENT} metze (This used to be commit 65f3bb8c19971c605fb81fa66317e2ee99132edc)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Typelist.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Typelist.pm b/source4/pidl/lib/Parse/Pidl/Typelist.pm
index e635411f3c..b2069c784b 100644
--- a/source4/pidl/lib/Parse/Pidl/Typelist.pm
+++ b/source4/pidl/lib/Parse/Pidl/Typelist.pm
@@ -174,8 +174,18 @@ sub enum_type_fn($)
{
my $enum = shift;
$enum->{TYPE} eq "ENUM" or die("not an enum");
- if (has_property($enum->{PARENT}, "enum8bit")) {
+
+ # for typedef enum { } we need to check $enum->{PARENT}
+ if (has_property($enum, "enum8bit")) {
return "uint8";
+ } elsif (has_property($enum, "enum16bit")) {
+ return "uint16";
+ } elsif (has_property($enum, "v1_enum")) {
+ return "uint32";
+ } elsif (has_property($enum->{PARENT}, "enum8bit")) {
+ return "uint8";
+ } elsif (has_property($enum->{PARENT}, "enum16bit")) {
+ return "uint16";
} elsif (has_property($enum->{PARENT}, "v1_enum")) {
return "uint32";
}