diff options
Diffstat (limited to 'odb/odb.cxx')
-rw-r--r-- | odb/odb.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/odb/odb.cxx b/odb/odb.cxx index 2a947f5..1f1d45a 100644 --- a/odb/odb.cxx +++ b/odb/odb.cxx @@ -480,6 +480,16 @@ main (int argc, char* argv[]) pi.fd, ios_base::out | ios_base::binary); ostream os (&fb); + // Add custom prologue if any. + // + strings const& pro (ops.odb_prologue ()); + for (size_t i (0); i < pro.size (); ++i) + { + os << "#line 1 \"<odb-prologue-" << i + 1 << ">\"" << endl + << pro[i] + << endl; + } + // Write the synthesized translation unit to stdout. // os << "#line 1 \"" << escape_path (input) << "\"" << endl; @@ -490,6 +500,21 @@ main (int argc, char* argv[]) wait_process (pi, argv[0]); return 1; } + + // Add the standard epilogue. + // + os << "#line 1 \"<standard-odb-epilogue>\"" << endl + << "#include <odb/container-traits.hxx>" << endl; + + // Add custom epilogue if any. + // + strings const& epi (ops.odb_epilogue ()); + for (size_t i (0); i < epi.size (); ++i) + { + os << "#line 1 \"<odb-epilogue-" << i + 1 << ">\"" << endl + << epi[i] + << endl; + } } if (!wait_process (pi, argv[0])) |