aboutsummaryrefslogtreecommitdiff
path: root/odb
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-03-01 08:16:58 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-03-01 08:16:58 +0200
commit7fa6f3a40d4df931e86add02e75678800395a374 (patch)
tree451f141b8170c22110133399de0481f5544bd117 /odb
parenta5aa1faa4597264feea2faf4611d251713960af7 (diff)
Generate pro/epilogues outside pre/post.hxx includes
Diffstat (limited to 'odb')
-rw-r--r--odb/generator.cxx44
1 files changed, 22 insertions, 22 deletions
diff --git a/odb/generator.cxx b/odb/generator.cxx
index 6971059..6f4c4a7 100644
--- a/odb/generator.cxx
+++ b/odb/generator.cxx
@@ -482,6 +482,15 @@ generate (options const& ops,
<< "#define " << guard << endl
<< endl;
+ // Copy prologue.
+ //
+ append_logue (hxx,
+ db,
+ ops.hxx_prologue (),
+ ops.hxx_prologue_file (),
+ "// Begin prologue.\n//",
+ "//\n// End prologue.");
+
// Version check.
//
hxx << "#include <odb/version.hxx>" << endl
@@ -494,15 +503,6 @@ generate (options const& ops,
hxx << "#include <odb/pre.hxx>" << endl
<< endl;
- // Copy prologue.
- //
- append_logue (hxx,
- db,
- ops.hxx_prologue (),
- ops.hxx_prologue_file (),
- "// Begin prologue.\n//",
- "//\n// End prologue.");
-
// Include main file(s).
//
for (paths::const_iterator i (inputs.begin ()); i != inputs.end (); ++i)
@@ -557,6 +557,9 @@ generate (options const& ops,
hxx << "#include " << ctx->process_include_path (ixx_name) << endl
<< endl;
+ hxx << "#include <odb/post.hxx>" << endl
+ << endl;
+
// Copy epilogue.
//
append_logue (hxx,
@@ -566,9 +569,6 @@ generate (options const& ops,
"// Begin epilogue.\n//",
"//\n// End epilogue.");
- hxx << "#include <odb/post.hxx>" << endl
- << endl;
-
hxx << "#endif // " << guard << endl;
if (ops.show_sloc ())
@@ -646,9 +646,6 @@ generate (options const& ops,
sloc_filter sloc (ctx->os);
- cxx << "#include <odb/pre.hxx>" << endl
- << endl;
-
// Copy prologue.
//
append_logue (cxx,
@@ -658,6 +655,9 @@ generate (options const& ops,
"// Begin prologue.\n//",
"//\n// End prologue.");
+ cxx << "#include <odb/pre.hxx>" << endl
+ << endl;
+
// Include query columns implementations for explicit instantiations.
//
string impl_guard;
@@ -713,6 +713,8 @@ generate (options const& ops,
}
}
+ cxx << "#include <odb/post.hxx>" << endl;
+
// Copy epilogue.
//
append_logue (cxx,
@@ -722,8 +724,6 @@ generate (options const& ops,
"// Begin epilogue.\n//",
"//\n// End epilogue.");
- cxx << "#include <odb/post.hxx>" << endl;
-
if (ops.show_sloc ())
cerr << cxx_name << ": " << sloc.stream ().count () << endl;
@@ -739,9 +739,6 @@ generate (options const& ops,
sloc_filter sloc (ctx->os);
- sch << "#include <odb/pre.hxx>" << endl
- << endl;
-
// Copy prologue.
//
append_logue (sch,
@@ -751,6 +748,9 @@ generate (options const& ops,
"// Begin prologue.\n//",
"//\n// End prologue.");
+ sch << "#include <odb/pre.hxx>" << endl
+ << endl;
+
sch << "#include <odb/database.hxx>" << endl
<< "#include <odb/schema-catalog-impl.hxx>" << endl
<< endl
@@ -778,6 +778,8 @@ generate (options const& ops,
}
}
+ sch << "#include <odb/post.hxx>" << endl;
+
// Copy epilogue.
//
append_logue (sch,
@@ -787,8 +789,6 @@ generate (options const& ops,
"// Begin epilogue.\n//",
"//\n// End epilogue.");
- sch << "#include <odb/post.hxx>" << endl;
-
if (ops.show_sloc ())
cerr << sch_name << ": " << sloc.stream ().count () << endl;