summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl
diff options
context:
space:
mode:
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl')
-rw-r--r--source4/pidl/lib/Parse/Pidl/NDR.pm2
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm3
-rw-r--r--source4/pidl/lib/Parse/Pidl/Typelist.pm15
3 files changed, 17 insertions, 3 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/NDR.pm b/source4/pidl/lib/Parse/Pidl/NDR.pm
index 80ecec938a..1d059ebdf7 100644
--- a/source4/pidl/lib/Parse/Pidl/NDR.pm
+++ b/source4/pidl/lib/Parse/Pidl/NDR.pm
@@ -633,7 +633,7 @@ sub FindNestedTypes($$)
sub FindNestedTypes($$);
my ($l, $t) = @_;
- return if not defined($t->{ELEMENTS});
+ return unless defined($t->{ELEMENTS});
return if ($t->{TYPE} eq "ENUM");
return if ($t->{TYPE} eq "BITMAP");
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
index abbfe2259b..cfd16c7b40 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
@@ -12,7 +12,7 @@ require Exporter;
@EXPORT_OK = qw(check_null_pointer GenerateFunctionInEnv GenerateFunctionOutEnv EnvSubstituteValue GenerateStructEnv NeededFunction NeededElement NeededType $res NeededInterface TypeFunctionName ParseElementPrint);
use strict;
-use Parse::Pidl::Typelist qw(hasType getType mapTypeName);
+use Parse::Pidl::Typelist qw(hasType getType mapTypeName typeHasBody);
use Parse::Pidl::Util qw(has_property ParseExpr ParseExprExt print_uuid);
use Parse::Pidl::CUtil qw(get_pointer_to get_value_of);
use Parse::Pidl::NDR qw(GetPrevLevel GetNextLevel ContainsDeferred);
@@ -2543,6 +2543,7 @@ sub ParseInterface($$$)
# Typedefs
foreach my $d (@{$interface->{TYPES}}) {
+ next unless typeHasBody($d);
($needed->{TypeFunctionName("ndr_push", $d)}) && $self->ParseTypePushFunction($d, "r");
($needed->{TypeFunctionName("ndr_pull", $d)}) && $self->ParseTypePullFunction($d, "r");
($needed->{TypeFunctionName("ndr_print", $d)}) && $self->ParseTypePrintFunction($d, "r");
diff --git a/source4/pidl/lib/Parse/Pidl/Typelist.pm b/source4/pidl/lib/Parse/Pidl/Typelist.pm
index 3721800b97..aad0cf426c 100644
--- a/source4/pidl/lib/Parse/Pidl/Typelist.pm
+++ b/source4/pidl/lib/Parse/Pidl/Typelist.pm
@@ -9,7 +9,7 @@ require Exporter;
@ISA = qw(Exporter);
@EXPORT_OK = qw(hasType getType mapTypeName scalar_is_reference expandAlias
mapScalarType addType typeIs is_scalar enum_type_fn
- bitmap_type_fn mapType
+ bitmap_type_fn mapType typeHasBody
);
use vars qw($VERSION);
$VERSION = '0.01';
@@ -207,6 +207,19 @@ sub bitmap_type_fn($)
return "uint32";
}
+sub typeHasBody($)
+{
+ sub typeHasBody($);
+ my ($e) = @_;
+
+ if ($e->{TYPE} eq "TYPEDEF") {
+ return 0 unless(defined($e->{DATA}));
+ return typeHasBody($e->{DATA});
+ }
+
+ return defined($e->{ELEMENTS});
+}
+
sub mapType($$)
{
sub mapType($$);