diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-01-31 14:09:02 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-02-01 12:13:45 +0100 |
commit | 9fe4b695feefb2a94559ce978048fb8a2189f5ab (patch) | |
tree | b94484a7d1922a8596d95702b8b9fb9e9b1ef374 /pidl | |
parent | 6124148d66d90064ebe3fa2ecb2c6588705495a0 (diff) | |
download | samba-9fe4b695feefb2a94559ce978048fb8a2189f5ab.tar.gz |
pidl:Samba4/NDR/Parser: add support for 'ms_union' style aligment
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Feb 1 12:13:45 CET 2011 on sn-devel-104
Diffstat (limited to 'pidl')
-rw-r--r-- | pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 7bc5a32d5e3..69c13866250 100644 --- a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -1697,7 +1697,12 @@ sub ParseUnionPushPrimitives($$$$) } if (defined($e->{ALIGN})) { - $self->pidl("NDR_CHECK(ndr_push_union_align($ndr, $e->{ALIGN}));"); + if ($e->{IS_MS_UNION}) { + $self->pidl("/* ms_union is always aligned to the largest union arm*/"); + $self->pidl("NDR_CHECK(ndr_push_align($ndr, $e->{ALIGN}));"); + } else { + $self->pidl("NDR_CHECK(ndr_push_union_align($ndr, $e->{ALIGN}));"); + } } $self->pidl("switch (level) {"); @@ -1850,7 +1855,12 @@ sub ParseUnionPullPrimitives($$$$$) } if (defined($e->{ALIGN})) { - $self->pidl("NDR_CHECK(ndr_pull_union_align($ndr, $e->{ALIGN}));"); + if ($e->{IS_MS_UNION}) { + $self->pidl("/* ms_union is always aligned to the largest union arm*/"); + $self->pidl("NDR_CHECK(ndr_push_align($ndr, $e->{ALIGN}));"); + } else { + $self->pidl("NDR_CHECK(ndr_pull_union_align($ndr, $e->{ALIGN}));"); + } } $self->pidl("switch (level) {"); |