summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
diff options
context:
space:
mode:
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/Header.pm')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/Header.pm22
1 files changed, 14 insertions, 8 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
index 11ecc17001..2eddf22b05 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
@@ -57,7 +57,11 @@ sub HeaderElement($)
if (has_property($element, "represent_as")) {
pidl mapTypeName($element->{PROPERTIES}->{represent_as})." ";
} else {
- HeaderType($element, $element->{TYPE}, "");
+ if (ref($element->{TYPE}) eq "HASH") {
+ HeaderType($element, $element->{TYPE}, $element->{TYPE}->{NAME});
+ } else {
+ HeaderType($element, $element->{TYPE}, "");
+ }
pidl " ";
my $numstar = $element->{POINTERS};
if ($numstar >= 1) {
@@ -90,14 +94,14 @@ sub HeaderElement($)
sub HeaderStruct($$)
{
my($struct,$name) = @_;
- pidl "struct $name {\n";
+ pidl "struct $name";
+ return if (not defined($struct->{ELEMENTS}));
+ pidl " {\n";
$tab_depth++;
my $el_count=0;
- if (defined $struct->{ELEMENTS}) {
- foreach (@{$struct->{ELEMENTS}}) {
- HeaderElement($_);
- $el_count++;
- }
+ foreach (@{$struct->{ELEMENTS}}) {
+ HeaderElement($_);
+ $el_count++;
}
if ($el_count == 0) {
# some compilers can't handle empty structures
@@ -174,7 +178,9 @@ sub HeaderUnion($$)
my($union,$name) = @_;
my %done = ();
- pidl "union $name {\n";
+ pidl "union $name";
+ return if (not defined($union->{ELEMENTS}));
+ pidl " {\n";
$tab_depth++;
foreach my $e (@{$union->{ELEMENTS}}) {
if ($e->{TYPE} ne "EMPTY") {