From 2240c904c16aa0c5cdb261c17070d971f06a8c01 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 8 May 2018 13:59:35 +0200 Subject: Omit TR1 support from C++11 and up --- odb/header.cxx | 33 ++++++++++++++++++--------------- odb/odb.cxx | 22 ++++++++++++++-------- 2 files changed, 32 insertions(+), 23 deletions(-) diff --git a/odb/header.cxx b/odb/header.cxx index 6654a42..48c55de 100644 --- a/odb/header.cxx +++ b/odb/header.cxx @@ -778,22 +778,25 @@ namespace header << "#include " << endl << "#include " << 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.features.tr1_pointer) - { - os << "#include " << endl - << "#include " << endl; - } - else if (ctx.features.boost_pointer) + if (ctx.options.std () == cxx_version::cxx98) { - os << "#ifdef BOOST_TR1_MEMORY_HPP_INCLUDED" << endl - << "# include " << endl - << "# include " << endl - << "#endif" << 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.features.tr1_pointer) + { + os << "#include " << endl + << "#include " << endl; + } + else if (ctx.features.boost_pointer) + { + os << "#ifdef BOOST_TR1_MEMORY_HPP_INCLUDED" << endl + << "# include " << endl + << "# include " << endl + << "#endif" << endl; + } } os << "#include " << endl; diff --git a/odb/odb.cxx b/odb/odb.cxx index d48e4d6..f7f6de2 100644 --- a/odb/odb.cxx +++ b/odb/odb.cxx @@ -1019,6 +1019,8 @@ main (int argc, char* argv[]) if (!ops.trace ()) { + bool tr1 (ops.std () == cxx_version::cxx98); + // Add the standard epilogue at the end so that we see all // the declarations. // @@ -1029,20 +1031,24 @@ main (int argc, char* argv[]) // 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; + os << "#include " << endl; + + if (tr1) + os << "#ifndef BOOST_TR1_MEMORY_HPP_INCLUDED" << endl + << "# include " << endl + << "#endif" << endl; // Standard wrapper traits. // - os << "#include " << endl - << "#include " << endl; + os << "#include " << endl; + if (tr1) + os << "#include " << endl; // Standard pointer traits. // - os << "#include " << endl - << "#include " << endl; + os << "#include " << endl; + if (tr1) + os << "#include " << endl; // Standard container traits. // -- cgit v1.1