From 7d380795b63c9b6e5196607960a35cfc90bdf1d9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 27 Sep 2010 21:03:45 -0700 Subject: pidl: added ifdef guards around ndr headers this prevents us parsing the leading headers needlessly --- pidl/lib/Parse/Pidl/Samba4/Header.pm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'pidl') 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 \n"; } @@ -428,6 +441,8 @@ sub Parse($) ($_->{TYPE} eq "INCLUDE") && HeaderInclude(@{$_->{PATHS}}); } + pidl "#endif /* _PIDL_HEADER_$ifacename */\n"; + return $res; } -- cgit