summaryrefslogtreecommitdiff
path: root/odb/generator.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-10-21 09:12:13 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-10-21 09:12:13 +0200
commit42f627e353e28d4612d1e4f03a428162ca7ef130 (patch)
treed9cc6fefbd47dfd816ef4ec125ea657eb16909fb /odb/generator.cxx
parentb1020d6a60050bd0e84f32a79739f0bf16935a51 (diff)
Move prologue/epilogue inside pre/post includes
Diffstat (limited to 'odb/generator.cxx')
-rw-r--r--odb/generator.cxx36
1 files changed, 18 insertions, 18 deletions
diff --git a/odb/generator.cxx b/odb/generator.cxx
index 252b6df..9a0c57e 100644
--- a/odb/generator.cxx
+++ b/odb/generator.cxx
@@ -233,15 +233,6 @@ generate (options const& ops, semantics::unit& unit, path const& p)
<< "#define " << guard << endl
<< endl;
- // Copy prologue.
- //
- hxx << "// Begin prologue." << endl
- << "//" << endl;
- append (hxx, ops.hxx_prologue (), ops.hxx_prologue_file ());
- hxx << "//" << endl
- << "// End prologue." << endl
- << endl;
-
// Version check.
//
hxx << "#include <odb/version.hxx>" << endl
@@ -254,6 +245,15 @@ generate (options const& ops, semantics::unit& unit, path const& p)
hxx << "#include <odb/pre.hxx>" << endl
<< endl;
+ // Copy prologue.
+ //
+ hxx << "// Begin prologue." << endl
+ << "//" << endl;
+ append (hxx, ops.hxx_prologue (), ops.hxx_prologue_file ());
+ hxx << "//" << endl
+ << "// End prologue." << endl
+ << endl;
+
hxx << "#include " << (br ? '<' : '"') << ip << file <<
(br ? '>' : '"') << endl
<< endl;
@@ -276,9 +276,6 @@ generate (options const& ops, semantics::unit& unit, path const& p)
(br ? '>' : '"') << endl
<< endl;
- hxx << "#include <odb/post.hxx>" << endl
- << endl;
-
// Copy epilogue.
//
hxx << "// Begin epilogue." << endl
@@ -288,6 +285,9 @@ generate (options const& ops, semantics::unit& unit, path const& p)
<< "// End epilogue." << endl
<< endl;
+ hxx << "#include <odb/post.hxx>" << endl
+ << endl;
+
hxx << "#endif // " << guard << endl;
}
@@ -335,6 +335,9 @@ generate (options const& ops, semantics::unit& unit, path const& p)
{
cxx_filter filt (cxx);
+ cxx << "#include <odb/pre.hxx>" << endl
+ << endl;
+
// Copy prologue.
//
cxx << "// Begin prologue." << endl
@@ -344,9 +347,6 @@ generate (options const& ops, semantics::unit& unit, path const& p)
<< "// End prologue." << endl
<< endl;
- cxx << "#include <odb/pre.hxx>" << endl
- << endl;
-
cxx << "#include " << (br ? '<' : '"') << ip << hxx_name <<
(br ? '>' : '"') << endl
<< endl;
@@ -367,9 +367,6 @@ generate (options const& ops, semantics::unit& unit, path const& p)
}
}
- cxx << "#include <odb/post.hxx>" << endl
- << endl;
-
// Copy epilogue.
//
cxx << "// Begin epilogue." << endl
@@ -377,6 +374,9 @@ generate (options const& ops, semantics::unit& unit, path const& p)
append (cxx, ops.cxx_epilogue (), ops.cxx_epilogue_file ());
cxx << "//" << endl
<< "// End epilogue." << endl;
+
+ cxx << "#include <odb/post.hxx>" << endl
+ << endl;
}
// SQL