From e6181e6a87a5e38e4e02b09f855d37fd882ae513 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 21 Jun 2013 10:33:48 +0200 Subject: Various bug fixes for dynamic multi-database support --- odb/generator.cxx | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'odb/generator.cxx') diff --git a/odb/generator.cxx b/odb/generator.cxx index d5ead7c..6bdd594 100644 --- a/odb/generator.cxx +++ b/odb/generator.cxx @@ -499,19 +499,21 @@ generate (options const& ops, for (paths::const_iterator i (inputs.begin ()); i != inputs.end (); ++i) hxx << "#include " << ctx->process_include_path (i->leaf ().string ()) << endl; + hxx << endl; + // There are no -odb.hxx includes if we are generating code for + // everything. + // + if (!ops.at_once ()) + if (include::generate (true)) + hxx << endl; + { // We don't want to indent prologues/epilogues. // ind_filter ind (ctx->os); - // There are no -odb.hxx includes if we are generating code for - // everything. - // - if (!ops.at_once ()) - include::generate (true); - switch (db) { case database::common: @@ -660,6 +662,12 @@ generate (options const& ops, cxx << "#include " << ctx->process_include_path (hxx_name) << endl; + // There are no -odb.hxx includes if we are generating code for + // everything. + // + if (!ops.at_once ()) + include::generate (false); + if (!impl_guard.empty ()) cxx << "#undef " << impl_guard << endl; @@ -670,12 +678,6 @@ generate (options const& ops, // ind_filter ind (ctx->os); - // There are no -odb.hxx includes if we are generating code for - // everything. - // - if (!ops.at_once ()) - include::generate (false); - switch (db) { case database::common: -- cgit v1.1