summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl
diff options
context:
space:
mode:
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";
}