aboutsummaryrefslogtreecommitdiff
path: root/odb/header.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-11-16 08:49:35 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-11-16 08:49:35 +0200
commit302b804ec633889f26dc54d937d9becc09246152 (patch)
tree730c672f1cbeb89d9be85bbf53c7f2f3f0bd9486 /odb/header.cxx
parent89a3b6133ade1ccb3a8e9ab9c86eac6aaef5db69 (diff)
Rework pointer traits, add naked, auto_ptr, and TR1 specializations
Diffstat (limited to 'odb/header.cxx')
-rw-r--r--odb/header.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/odb/header.cxx b/odb/header.cxx
index 35a95ab..d7fed95 100644
--- a/odb/header.cxx
+++ b/odb/header.cxx
@@ -87,6 +87,26 @@ generate_header (context& ctx)
<< "#include <odb/traits.hxx>" << endl
<< endl;
+ // In case of a boost TR1 implementation, we cannot distinguish
+ // between the boost::shared_ptr and std::tr1::shared_ptr usage since
+ // the latter is just a using-declaration for the former. To resolve
+ // this we will include TR1 traits if the Boost TR1 header is included.
+ //
+ if (ctx.unit.count ("tr1-pointer-used") &&
+ ctx.unit.get<bool> ("tr1-pointer-used"))
+ {
+ ctx.os << "#include <odb/tr1-pointer-traits.hxx>" << endl
+ << endl;
+ }
+ else if (ctx.unit.count ("boost-pointer-used") &&
+ ctx.unit.get<bool> ("boost-pointer-used"))
+ {
+ ctx.os << "#ifdef BOOST_TR1_MEMORY_HPP_INCLUDED" << endl
+ << "# include <odb/tr1-pointer-traits.hxx>" << endl
+ << "#endif" << endl
+ << endl;
+ }
+
/*
traversal::unit unit;
traversal::defines unit_defines;