aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-06-28 11:21:32 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-06-28 11:21:32 +0200
commitbf0b1014b260f04a3446a4a8ccd3817083777787 (patch)
treebf614723dffc5e10c178d7e4a5f6e6c8e7c65d45
parente8e2a63053ba5440cc9d4f62d248443e2b775e13 (diff)
Make build2-built ODB usable in C++98 mode
-rw-r--r--odb/header.cxx2
-rw-r--r--odb/odb.cxx23
2 files changed, 14 insertions, 11 deletions
diff --git a/odb/header.cxx b/odb/header.cxx
index 10518a1..fdb1ea6 100644
--- a/odb/header.cxx
+++ b/odb/header.cxx
@@ -778,6 +778,7 @@ namespace header
<< "#include <odb/wrapper-traits.hxx>" << endl
<< "#include <odb/pointer-traits.hxx>" << endl;
+#ifndef ODB_BUILD2
if (ctx.options.std () == cxx_version::cxx98)
{
// In case of a boost TR1 implementation, we cannot distinguish
@@ -798,6 +799,7 @@ namespace header
<< "#endif" << endl;
}
}
+#endif
os << "#include <odb/container-traits.hxx>" << endl;
diff --git a/odb/odb.cxx b/odb/odb.cxx
index 5160985..f5dcd42 100644
--- a/odb/odb.cxx
+++ b/odb/odb.cxx
@@ -1057,8 +1057,6 @@ 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.
//
@@ -1071,26 +1069,29 @@ main (int argc, char* argv[])
//
os << "#include <memory>" << endl;
- if (tr1)
- os << "#ifndef BOOST_TR1_MEMORY_HPP_INCLUDED" << endl
- << "# include <tr1/memory>" << endl
- << "#endif" << endl;
-
// Standard wrapper traits.
//
os << "#include <odb/wrapper-traits.hxx>" << endl;
- if (tr1)
- os << "#include <odb/tr1/wrapper-traits.hxx>" << endl;
// Standard pointer traits.
//
os << "#include <odb/pointer-traits.hxx>" << endl;
- if (tr1)
- os << "#include <odb/tr1/pointer-traits.hxx>" << endl;
// Standard container traits.
//
os << "#include <odb/container-traits.hxx>" << endl;
+
+ // TR1 wrapper/pointer traits.
+ //
+#ifndef ODB_BUILD2
+ if (ops.std () == cxx_version::cxx98)
+ os << endl
+ << "#ifndef BOOST_TR1_MEMORY_HPP_INCLUDED" << endl
+ << "# include <tr1/memory>" << endl
+ << "#endif" << endl
+ << "#include <odb/tr1/wrapper-traits.hxx>" << endl
+ << "#include <odb/tr1/pointer-traits.hxx>" << endl;
+#endif
}
}