summaryrefslogtreecommitdiff
path: root/source4/build/pidl/parser.pm
diff options
context:
space:
mode:
Diffstat (limited to 'source4/build/pidl/parser.pm')
-rw-r--r--source4/build/pidl/parser.pm20
1 files changed, 20 insertions, 0 deletions
diff --git a/source4/build/pidl/parser.pm b/source4/build/pidl/parser.pm
index ac45b4d9bc..1368099403 100644
--- a/source4/build/pidl/parser.pm
+++ b/source4/build/pidl/parser.pm
@@ -1036,6 +1036,23 @@ sub ParseStructNdrSize($)
}
#####################################################################
+# calculate size of ndr struct
+sub ParseUnionNdrSize($)
+{
+ my $t = shift;
+ my $static = fn_prefix($t);
+ my $sizevar;
+
+ pidl "size_t ndr_size_$t->{NAME}(const union $t->{NAME} *r, uint32_t level, int flags)\n";
+ pidl "{\n";
+ if (my $flags = util::has_property($t, "flag")) {
+ pidl "\tflags |= $flags;\n";
+ }
+ pidl "\treturn ndr_size_union(r, flags, level, (ndr_push_union_fn_t)ndr_push_$t->{NAME});\n";
+ pidl "}\n\n";
+}
+
+#####################################################################
# parse a union - push side
sub ParseUnionPush($)
{
@@ -1395,6 +1412,9 @@ sub ParseTypedefNdrSize($)
($t->{DATA}->{TYPE} eq "STRUCT") &&
ParseStructNdrSize($t);
+
+ ($t->{DATA}->{TYPE} eq "UNION") &&
+ ParseUnionNdrSize($t);
}
#####################################################################