From 42f627e353e28d4612d1e4f03a428162ca7ef130 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 21 Oct 2010 09:12:13 +0200 Subject: Move prologue/epilogue inside pre/post includes --- odb/generator.cxx | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'odb/generator.cxx') 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 " << endl @@ -254,6 +245,15 @@ generate (options const& ops, semantics::unit& unit, path const& p) hxx << "#include " << 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 " << 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 " << 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 " << 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 " << 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 " << 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 " << endl + << endl; } // SQL -- cgit v1.1