From 9fe4b695feefb2a94559ce978048fb8a2189f5ab Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 31 Jan 2011 14:09:02 +0100 Subject: pidl:Samba4/NDR/Parser: add support for 'ms_union' style aligment metze Autobuild-User: Stefan Metzmacher Autobuild-Date: Tue Feb 1 12:13:45 CET 2011 on sn-devel-104 --- pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 14 ++++++++++++-- 1 file 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 7bc5a32d5e..69c1386625 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) {"); -- cgit