From 89a3b6133ade1ccb3a8e9ab9c86eac6aaef5db69 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 15 Nov 2010 17:46:28 +0200 Subject: Add support for custom object pointers New option: --default-pointer. New object pragma specifier: pointer. --- odb/odb.cxx | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'odb/odb.cxx') diff --git a/odb/odb.cxx b/odb/odb.cxx index 1f1d45a..a1beccf 100644 --- a/odb/odb.cxx +++ b/odb/odb.cxx @@ -480,6 +480,10 @@ main (int argc, char* argv[]) pi.fd, ios_base::out | ios_base::binary); ostream os (&fb); + // Add the standard prologue. + // + // os << "#line 1 \"\"" << endl; + // Add custom prologue if any. // strings const& pro (ops.odb_prologue ()); @@ -501,11 +505,6 @@ main (int argc, char* argv[]) return 1; } - // Add the standard epilogue. - // - os << "#line 1 \"\"" << endl - << "#include " << endl; - // Add custom epilogue if any. // strings const& epi (ops.odb_epilogue ()); @@ -515,6 +514,25 @@ main (int argc, char* argv[]) << epi[i] << endl; } + + // Add the standard epilogue at the end so that we see all + // the declarations. + // + os << "#line 1 \"\"" << endl; + + // Includes for standard smart pointers. The Boost TR1 header + // may or may not delegate to the GCC implementation. In either + // case, the necessary declarations will be provided so we don't + // need to do anything. + // + os << "#include " << endl + << "#ifndef BOOST_TR1_MEMORY_HPP_INCLUDED" << endl + << "# include " << endl + << "#endif" << endl; + + // Standard containers traits. + // + os << "#include " << endl; } if (!wait_process (pi, argv[0])) -- cgit v1.1