aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-12-13 11:37:33 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-12-13 11:37:33 +0200
commitd6c627f34cf855df62950af14c6d693517576a88 (patch)
treee48aeaa68e71b659a3410c8e293438fd70655ef4
parentf195573dd0cba47cb84b4888a83127ab0795022d (diff)
Add a wrapper header for TR1 <memory>
-rw-r--r--odb/tr1/memory.hxx39
1 files changed, 39 insertions, 0 deletions
diff --git a/odb/tr1/memory.hxx b/odb/tr1/memory.hxx
new file mode 100644
index 0000000..8911498
--- /dev/null
+++ b/odb/tr1/memory.hxx
@@ -0,0 +1,39 @@
+// file : odb/tr1/memory.hxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC
+// license : GNU GPL v2; see accompanying LICENSE file
+
+#ifndef ODB_TR1_MEMORY_HXX
+#define ODB_TR1_MEMORY_HXX
+
+//
+// Try to include TR1 <memory> in a compiler-specific manner. Fall back
+// on the Boost TR1 implementation if the compiler does not support TR1.
+//
+
+#include <cstddef> // __GLIBCXX__, _HAS_TR1
+
+// GNU C++ or Intel C++ using libstd++.
+//
+#if defined (__GNUC__) && __GNUC__ >= 4 && defined (__GLIBCXX__)
+# include <tr1/memory>
+//
+// IBM XL C++.
+//
+#elif defined (__xlC__) && __xlC__ >= 0x0900
+# define __IBMCPP_TR1__
+# include <memory>
+//
+// VC++ or Intel C++ using VC++ standard library.
+//
+#elif defined (_MSC_VER) && \
+ (_MSC_VER == 1500 && defined (_HAS_TR1) || _MSC_VER > 1500)
+# include <memory>
+//
+// Boost fall-back.
+//
+#else
+# include <boost/tr1/memory.hpp>
+#endif
+
+#endif // ODB_TR1_MEMORY_HXX