aboutsummaryrefslogtreecommitdiff
path: root/xsd
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-10-14 12:27:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-10-14 12:27:37 +0200
commitf0a4f34da1418cf299cf9f41a772f513b180e2cf (patch)
tree46653e6ca95e27b120dcc73bca9e526c95172827 /xsd
parent5be9f5cc62919ae55311d369a0a1962175ed0565 (diff)
Move prologue/epilogue inside pre/post includes
Diffstat (limited to 'xsd')
-rw-r--r--xsd/cxx/parser/generator.cxx30
-rw-r--r--xsd/cxx/tree/generator.cxx72
2 files changed, 51 insertions, 51 deletions
diff --git a/xsd/cxx/parser/generator.cxx b/xsd/cxx/parser/generator.cxx
index 617ff4f..2ce958f 100644
--- a/xsd/cxx/parser/generator.cxx
+++ b/xsd/cxx/parser/generator.cxx
@@ -1195,6 +1195,18 @@ namespace CXX
<< "#define " << guard << endl
<< endl;
+ // Version check.
+ //
+ hxx << "#include <xsd/cxx/config.hxx>" << endl
+ << endl
+ << "#if (XSD_INT_VERSION != " << XSD_INT_VERSION << "L)" << endl
+ << "#error XSD runtime version mismatch" << endl
+ << "#endif" << endl
+ << endl;
+
+ hxx << "#include <xsd/cxx/pre.hxx>" << endl
+ << endl;
+
// Copy prologue.
//
hxx << "// Begin prologue." << endl
@@ -1208,19 +1220,7 @@ namespace CXX
<< "// End prologue." << endl
<< endl;
- // Version check.
- //
- hxx << "#include <xsd/cxx/config.hxx>" << endl
- << endl
- << "#if (XSD_INT_VERSION != " << XSD_INT_VERSION << "L)" << endl
- << "#error XSD runtime version mismatch" << endl
- << "#endif" << endl
- << endl;
-
{
- hxx << "#include <xsd/cxx/pre.hxx>" << endl
- << endl;
-
// Set auto-indentation.
//
Indentation::Clip<Indentation::CXX, WideChar> hxx_clip (hxx);
@@ -1236,9 +1236,6 @@ namespace CXX
if (inline_)
hxx << "#include " << ctx.process_include_path (ixx_name) << endl;
-
- hxx << "#include <xsd/cxx/post.hxx>" << endl
- << endl;
}
// Copy epilogue.
@@ -1254,6 +1251,9 @@ namespace CXX
<< "// End epilogue." << endl
<< endl;
+ hxx << "#include <xsd/cxx/post.hxx>" << endl
+ << endl;
+
hxx << "#endif // " << guard << endl;
if (show_sloc)
diff --git a/xsd/cxx/tree/generator.cxx b/xsd/cxx/tree/generator.cxx
index 3b0e6cd..342d5c0 100644
--- a/xsd/cxx/tree/generator.cxx
+++ b/xsd/cxx/tree/generator.cxx
@@ -1268,6 +1268,18 @@ namespace CXX
<< "#define " << guard << endl
<< endl;
+ // Version check.
+ //
+ fwd << "#include <xsd/cxx/version.hxx>" << endl
+ << endl
+ << "#if (XSD_INT_VERSION != " << XSD_INT_VERSION << "L)" << endl
+ << "#error XSD runtime version mismatch" << endl
+ << "#endif" << endl
+ << endl;
+
+ fwd << "#include <xsd/cxx/pre.hxx>" << endl
+ << endl;
+
// Copy prologue.
//
fwd << "// Begin prologue." << endl
@@ -1282,19 +1294,7 @@ namespace CXX
<< "// End prologue." << endl
<< endl;
- // Version check.
- //
- fwd << "#include <xsd/cxx/version.hxx>" << endl
- << endl
- << "#if (XSD_INT_VERSION != " << XSD_INT_VERSION << "L)" << endl
- << "#error XSD runtime version mismatch" << endl
- << "#endif" << endl
-
- << endl;
{
- fwd << "#include <xsd/cxx/pre.hxx>" << endl
- << endl;
-
if (ctx.char_type == L"char")
{
fwd << "#ifndef XSD_USE_CHAR" << endl
@@ -1328,9 +1328,6 @@ namespace CXX
// Generate.
//
generate_forward (ctx);
-
- fwd << "#include <xsd/cxx/post.hxx>" << endl
- << endl;
}
// Copy epilogue.
@@ -1347,6 +1344,9 @@ namespace CXX
<< "// End epilogue." << endl
<< endl;
+ fwd << "#include <xsd/cxx/post.hxx>" << endl
+ << endl;
+
fwd << "#endif // " << guard << endl;
if (show_sloc)
@@ -1384,6 +1384,18 @@ namespace CXX
<< "#define " << guard << endl
<< endl;
+ // Version check.
+ //
+ hxx << "#include <xsd/cxx/config.hxx>" << endl
+ << endl
+ << "#if (XSD_INT_VERSION != " << XSD_INT_VERSION << "L)" << endl
+ << "#error XSD runtime version mismatch" << endl
+ << "#endif" << endl
+ << endl;
+
+ hxx << "#include <xsd/cxx/pre.hxx>" << endl
+ << endl;
+
// Copy prologue.
//
hxx << "// Begin prologue." << endl
@@ -1397,19 +1409,7 @@ namespace CXX
<< "// End prologue." << endl
<< endl;
- // Version check.
- //
- hxx << "#include <xsd/cxx/config.hxx>" << endl
- << endl
- << "#if (XSD_INT_VERSION != " << XSD_INT_VERSION << "L)" << endl
- << "#error XSD runtime version mismatch" << endl
- << "#endif" << endl
- << endl;
-
{
- hxx << "#include <xsd/cxx/pre.hxx>" << endl
- << endl;
-
// Generate character selection defines.
//
if (!forward)
@@ -1482,9 +1482,6 @@ namespace CXX
<< "#endif // XSD_DONT_INCLUDE_INLINE" << endl
<< endl;
}
-
- hxx << "#include <xsd/cxx/post.hxx>" << endl
- << endl;
}
// Copy epilogue.
@@ -1500,6 +1497,9 @@ namespace CXX
<< "// End epilogue." << endl
<< endl;
+ hxx << "#include <xsd/cxx/post.hxx>" << endl
+ << endl;
+
hxx << "#endif // " << guard << endl;
if (show_sloc)
@@ -1663,6 +1663,9 @@ namespace CXX
Indentation::Clip<Indentation::SLOC, WideChar> cxx_sloc (os);
+ os << "#include <xsd/cxx/pre.hxx>" << endl
+ << endl;
+
// Copy prologue.
//
os << "// Begin prologue." << endl
@@ -1678,9 +1681,6 @@ namespace CXX
<< endl;
{
- os << "#include <xsd/cxx/pre.hxx>" << endl
- << endl;
-
// Set auto-indentation.
//
Indentation::Clip<Indentation::CXX, WideChar> cxx_clip (os);
@@ -1711,9 +1711,6 @@ namespace CXX
if (!ops.value<CLI::generate_insertion> ().empty ())
generate_stream_insertion_source (ctx);
-
- os << "#include <xsd/cxx/post.hxx>" << endl
- << endl;
}
// Copy epilogue.
@@ -1730,6 +1727,9 @@ namespace CXX
<< "// End epilogue." << endl
<< endl;
+ os << "#include <xsd/cxx/post.hxx>" << endl
+ << endl;
+
if (show_sloc)
{
wcerr << cxx_paths[part] << ": "