diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-09-27 21:03:45 -0700 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-09-27 22:55:05 -0700 |
commit | 7d380795b63c9b6e5196607960a35cfc90bdf1d9 (patch) | |
tree | 31ad57186e73cba9a0762df52fe4044a5d421da8 /pidl/lib/Parse | |
parent | bc47af50eb0896c108b7acc5323a897e27120252 (diff) | |
download | samba-7d380795b63c9b6e5196607960a35cfc90bdf1d9.tar.gz samba-7d380795b63c9b6e5196607960a35cfc90bdf1d9.tar.bz2 samba-7d380795b63c9b6e5196607960a35cfc90bdf1d9.zip |
pidl: added ifdef guards around ndr headers
this prevents us parsing the leading headers needlessly
Diffstat (limited to 'pidl/lib/Parse')
-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; } |