aboutsummaryrefslogtreecommitdiff
path: root/odb/odb.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-11-15 17:46:28 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-11-15 17:46:28 +0200
commit89a3b6133ade1ccb3a8e9ab9c86eac6aaef5db69 (patch)
tree394eb90c5acc9b55460bc7e4961cf791a60e397d /odb/odb.cxx
parent61acf05c698a8b611c5ccf6aed8d3e654d5acf8e (diff)
Add support for custom object pointers
New option: --default-pointer. New object pragma specifier: pointer.
Diffstat (limited to 'odb/odb.cxx')
-rw-r--r--odb/odb.cxx28
1 files changed, 23 insertions, 5 deletions
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 \"<standard-odb-prologue>\"" << 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 \"<standard-odb-epilogue>\"" << endl
- << "#include <odb/container-traits.hxx>" << 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 \"<standard-odb-epilogue>\"" << 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 <memory>" << endl
+ << "#ifndef BOOST_TR1_MEMORY_HPP_INCLUDED" << endl
+ << "# include <tr1/memory>" << endl
+ << "#endif" << endl;
+
+ // Standard containers traits.
+ //
+ os << "#include <odb/container-traits.hxx>" << endl;
}
if (!wait_process (pi, argv[0]))