aboutsummaryrefslogtreecommitdiff
path: root/xsd
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-07-17 08:35:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-07-17 08:35:07 +0200
commit4e51c7d4f0cc22441716389845d10ab36c09bf42 (patch)
tree568e181c1c124505586379851a9ca2520950cf94 /xsd
parent179f9d1db56d8b81235e6f85734fcc08e2f33fcc (diff)
Generate forward file include earlier
We need to get all the configuration defines (e.g., CXX11) before we include any runtime headers.
Diffstat (limited to 'xsd')
-rw-r--r--xsd/cxx/tree/generator.cxx18
1 files changed, 10 insertions, 8 deletions
diff --git a/xsd/cxx/tree/generator.cxx b/xsd/cxx/tree/generator.cxx
index f7eb1fa..7a413bd 100644
--- a/xsd/cxx/tree/generator.cxx
+++ b/xsd/cxx/tree/generator.cxx
@@ -870,6 +870,14 @@ namespace CXX
<< endl;
}
}
+ else if (!generate_xml_schema)
+ {
+ // Generate it before the prologue so that we get the above
+ // defines.
+ //
+ hxx << "#include " << ctx.process_include_path (fwd_name)
+ << endl << endl;
+ }
// Copy prologue.
//
@@ -900,14 +908,8 @@ namespace CXX
{
ind_filter ind (hxx); // We don't want to indent prologues/epilogues.
- if (!generate_xml_schema)
- {
- if (forward)
- hxx << "#include " << ctx.process_include_path (fwd_name)
- << endl << endl;
- else
- generate_forward (ctx);
- }
+ if (!generate_xml_schema && !forward)
+ generate_forward (ctx);
generate_tree_header (ctx);