aboutsummaryrefslogtreecommitdiff
path: root/common/inverse/tr1-memory.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-11-22 14:20:22 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-11-22 14:20:22 +0200
commit73bcedf1a812136d338da7f274a37b02d0b30b0a (patch)
treed6b3c1f80839474c304b3b04980fd180022f9def /common/inverse/tr1-memory.hxx
parentececaecd27d0a9f3d52a5886f68bc8eac4fc5227 (diff)
Test one-to-{one,many} inverse relationships
Diffstat (limited to 'common/inverse/tr1-memory.hxx')
-rw-r--r--common/inverse/tr1-memory.hxx44
1 files changed, 44 insertions, 0 deletions
diff --git a/common/inverse/tr1-memory.hxx b/common/inverse/tr1-memory.hxx
new file mode 100644
index 0000000..76ac932
--- /dev/null
+++ b/common/inverse/tr1-memory.hxx
@@ -0,0 +1,44 @@
+// file : common/inverse/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 TR1_MEMORY_HXX
+#define TR1_MEMORY_HXX
+
+// Try to include TR1 <memory> in a compiler-specific manner. Define
+// HAVE_TR1_MEMORY if successfull. If the compiler does not provide
+// native TR1 support, fall-back on the Boost TR1 implementation if
+// HAVE_BOOST_TR1 is defined.
+//
+
+#include <cstddef> // __GLIBCXX__, _HAS_TR1
+
+// GNU C++ or Intel C++ using libstd++.
+//
+#if defined (__GNUC__) && __GNUC__ >= 4 && defined (__GLIBCXX__)
+# include <tr1/memory>
+# define HAVE_TR1_MEMORY 1
+//
+// IBM XL C++.
+//
+#elif defined (__xlC__) && __xlC__ >= 0x0900
+# define __IBMCPP_TR1__
+# include <memory>
+# define HAVE_TR1_MEMORY 1
+//
+// VC++ or Intel C++ using VC++ standard library.
+//
+#elif defined (_MSC_VER) && \
+ (_MSC_VER == 1500 && defined (_HAS_TR1) || _MSC_VER > 1500)
+# include <memory>
+# define HAVE_TR1_MEMORY 1
+//
+// Boost fall-back.
+//
+#elif defined (HAVE_BOOST_TR1)
+# include <boost/tr1/memory.hpp>
+# define HAVE_TR1_MEMORY 1
+#endif
+
+#endif // TR1_MEMORY_HXX