summaryrefslogtreecommitdiff
path: root/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-01-31 14:09:02 +0100
committerStefan Metzmacher <metze@samba.org>2011-02-01 12:13:45 +0100
commit9fe4b695feefb2a94559ce978048fb8a2189f5ab (patch)
treeb94484a7d1922a8596d95702b8b9fb9e9b1ef374 /pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
parent6124148d66d90064ebe3fa2ecb2c6588705495a0 (diff)
downloadsamba-9fe4b695feefb2a94559ce978048fb8a2189f5ab.tar.gz
samba-9fe4b695feefb2a94559ce978048fb8a2189f5ab.tar.bz2
samba-9fe4b695feefb2a94559ce978048fb8a2189f5ab.zip
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/lib/Parse/Pidl/Samba4/NDR/Parser.pm')
-rw-r--r--pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm14
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 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) {");