summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Samba4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-09-07 20:01:17 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:17:53 -0500
commit433ec0ba664c9eb53b26550e25973e2fc538646b (patch)
treede949bb457d4bcda7a0149d0dbd64297bc70a100 /source4/pidl/lib/Parse/Pidl/Samba4
parent4dff1f05f00560adc1deeb09b5e27dacad787783 (diff)
downloadsamba-433ec0ba664c9eb53b26550e25973e2fc538646b.tar.gz
samba-433ec0ba664c9eb53b26550e25973e2fc538646b.tar.bz2
samba-433ec0ba664c9eb53b26550e25973e2fc538646b.zip
r18228: Don't include Samba4-specific headers when building inside a Samba3 tree.
(This used to be commit d0f0d4600acad71ea4993f4e356735433d9bc5f0)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Samba4')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm39
1 files changed, 24 insertions, 15 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
index bf5e8fe441..9e4388e28d 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
@@ -2359,6 +2359,29 @@ sub ParseInterface($$)
pidl_hdr "#endif /* _HEADER_NDR_$interface->{NAME} */";
}
+sub GenerateIncludes()
+{
+ if (is_intree()) {
+ pidl "#include \"includes.h\"";
+ } else {
+ pidl "#define _GNU_SOURCE";
+ pidl "#include <stdint.h>";
+ pidl "#include <stdlib.h>";
+ pidl "#include <stdio.h>";
+ pidl "#include <stdbool.h>";
+ pidl "#include <stdarg.h>";
+ pidl "#include <string.h>";
+ }
+
+ # Samba3 has everything in include/includes.h
+ if (is_intree() != 3) {
+ pidl choose_header("libcli/util/nterr.h", "core/nterr.h");
+ pidl choose_header("librpc/gen_ndr/ndr_misc.h", "gen_ndr/ndr_misc.h");
+ pidl choose_header("librpc/gen_ndr/ndr_dcerpc.h", "gen_ndr/ndr_dcerpc.h");
+ pidl choose_header("librpc/rpc/dcerpc.h", "dcerpc.h"); #FIXME: This shouldn't be here!
+ }
+}
+
#####################################################################
# parse a parsed IDL structure back into an IDL file
sub Parse($$$)
@@ -2376,22 +2399,8 @@ sub Parse($$$)
pidl "/* parser auto-generated by pidl */";
pidl "";
- if (is_intree()) {
- pidl "#include \"includes.h\"";
- } else {
- pidl "#define _GNU_SOURCE";
- pidl "#include <stdint.h>";
- pidl "#include <stdlib.h>";
- pidl "#include <stdio.h>";
- pidl "#include <stdbool.h>";
- pidl "#include <stdarg.h>";
- pidl "#include <string.h>";
- }
- pidl choose_header("libcli/util/nterr.h", "core/nterr.h");
- pidl choose_header("librpc/gen_ndr/ndr_misc.h", "gen_ndr/ndr_misc.h");
- pidl choose_header("librpc/gen_ndr/ndr_dcerpc.h", "gen_ndr/ndr_dcerpc.h");
+ GenerateIncludes();
pidl "#include \"$ndr_header\"" if ($ndr_header);
- pidl choose_header("librpc/rpc/dcerpc.h", "dcerpc.h"); #FIXME: This shouldn't be here!
pidl "";
my %needed = ();