1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-24 13:57:43 +03:00

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
This commit is contained in:
Stefan Metzmacher 2011-01-31 14:09:02 +01:00
parent 6124148d66
commit 9fe4b695fe

View File

@ -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) {");