From e3162d376cf5eb7086f8398c347420b077a2202a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 16 Aug 2007 13:34:54 +0000 Subject: r24489: only typedef enum { ... } foo; enum's should look for has_properties() of $enum->{PARENT} metze (This used to be commit 65f3bb8c19971c605fb81fa66317e2ee99132edc) --- source4/pidl/lib/Parse/Pidl/Typelist.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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"; } -- cgit