From 302b804ec633889f26dc54d937d9becc09246152 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 16 Nov 2010 08:49:35 +0200 Subject: Rework pointer traits, add naked, auto_ptr, and TR1 specializations --- odb/header.cxx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'odb/header.cxx') 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 " << 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 ("tr1-pointer-used")) + { + ctx.os << "#include " << endl + << endl; + } + else if (ctx.unit.count ("boost-pointer-used") && + ctx.unit.get ("boost-pointer-used")) + { + ctx.os << "#ifdef BOOST_TR1_MEMORY_HPP_INCLUDED" << endl + << "# include " << endl + << "#endif" << endl + << endl; + } + /* traversal::unit unit; traversal::defines unit_defines; -- cgit v1.1