r4843: fixed the alignment handling of enumerated types
authorAndrew Tridgell <tridge@samba.org>
Wed, 19 Jan 2005 11:58:40 +0000 (11:58 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:09:00 +0000 (13:09 -0500)
(This used to be commit d2946dfabbc727633cdb17c3956fc120e214140c)

source4/build/pidl/parser.pm
source4/build/pidl/util.pm

index 077fcd438521d3e2c15eb04e78051255e4c62aa5..ac45b4d9bc6750f19e47eebef5624d6f7907565c 100644 (file)
@@ -192,6 +192,8 @@ sub struct_alignment
                                if (defined $structs{$e->{TYPE}}->{DATA}) {
                                        $a = union_alignment($structs{$e->{TYPE}}->{DATA});
                                }
+                       } elsif ($structs{$e->{TYPE}}->{DATA}->{TYPE} eq "ENUM") {
+                               $a = util::type_align($e);
                        }
                } else {
                        $a = util::type_align($e);
index bd87cf43178a6b6b784ed6490311858f917a88b1..39f84843cbd12b536d3be213d8324a7baa9ba8c6 100644 (file)
@@ -335,6 +335,11 @@ sub type_align($)
            return $ret;
     }
 
+    if (is_enum($type)) {
+           my $ret = type_align(get_enum($type));
+           return $ret;
+    }
+
     # it must be an external type - all we can do is guess 
     return 4;
 }