diff options
-rw-r--r-- | pidl/lib/Parse/Pidl/Samba4/Header.pm | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/Header.pm b/pidl/lib/Parse/Pidl/Samba4/Header.pm index be1df4b118..9788b2c123 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Header.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Header.pm @@ -5,7 +5,6 @@ # released under the GNU GPL package Parse::Pidl::Samba4::Header; - require Exporter; @ISA = qw(Exporter); @@ -412,6 +411,20 @@ sub Parse($) $res = ""; %headerstructs = (); pidl "/* header auto-generated by pidl */\n\n"; + + my $ifacename = ""; + + # work out a unique interface name + foreach (@{$ndr}) { + if ($_->{TYPE} eq "INTERFACE") { + $ifacename = $_->{NAME}; + last; + } + } + + pidl "#ifndef _PIDL_HEADER_$ifacename\n"; + pidl "#define _PIDL_HEADER_$ifacename\n\n"; + if (!is_intree()) { pidl "#include <util/data_blob.h>\n"; } @@ -428,6 +441,8 @@ sub Parse($) ($_->{TYPE} eq "INCLUDE") && HeaderInclude(@{$_->{PATHS}}); } + pidl "#endif /* _PIDL_HEADER_$ifacename */\n"; + return $res; } |