aboutsummaryrefslogtreecommitdiff
path: root/common/relationship
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-12-13 11:38:49 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-12-13 11:38:49 +0200
commit3fd22b7b86ebad8fbd4b66da3d63e6d9c1ca829c (patch)
treeebd661aba341b0d478cb3e359665ccb4bba6a81a /common/relationship
parentb0badbfd0fdbbadef588a2b518cbfb49f34bf9fd (diff)
Detect TR1 <memory> availability
Also use the wrapper header from libodb.
Diffstat (limited to 'common/relationship')
-rw-r--r--common/relationship/makefile3
-rw-r--r--common/relationship/test.hxx7
-rw-r--r--common/relationship/tr1-memory.hxx41
3 files changed, 7 insertions, 44 deletions
diff --git a/common/relationship/makefile b/common/relationship/makefile
index 7ed60cf..36c3c48 100644
--- a/common/relationship/makefile
+++ b/common/relationship/makefile
@@ -53,13 +53,12 @@ name := $(notdir $(src_base))
$(dist): db_id := @database@
$(dist): sources := $(cxx_tun)
$(dist): headers := $(odb_hdr)
-$(dist): export extra_headers := tr1-memory.hxx
$(dist): data_dist := test.std
$(dist): export name := $(name)
$(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \
$(call vc10projs,$(name))
$(dist):
- $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist))
+ $(call dist-data,$(sources) $(headers) $(data_dist))
$(call meta-automake,../template/Makefile.am)
$(call meta-vc9projs,../template/template,$(name))
$(call meta-vc10projs,../template/template,$(name))
diff --git a/common/relationship/test.hxx b/common/relationship/test.hxx
index cafdc99..486c417 100644
--- a/common/relationship/test.hxx
+++ b/common/relationship/test.hxx
@@ -6,15 +6,20 @@
#ifndef TEST_HXX
#define TEST_HXX
+#include <common/config.hxx> // HAVE_TR1_MEMORY
+
#include <set>
#include <map>
#include <vector>
#include <string>
#include <memory>
-#include "tr1-memory.hxx"
#include <odb/core.hxx>
+#ifdef HAVE_TR1_MEMORY
+# include <odb/tr1/memory.hxx>
+#endif
+
// Raw pointer.
//
#pragma db object pointer(obj1*)
diff --git a/common/relationship/tr1-memory.hxx b/common/relationship/tr1-memory.hxx
deleted file mode 100644
index a4ce28a..0000000
--- a/common/relationship/tr1-memory.hxx
+++ /dev/null
@@ -1,41 +0,0 @@
-// file : common/relationship/tr1-memory.hxx
-// author : Boris Kolpackov <boris@codesynthesis.com>
-// copyright : not copyrighted - public domain
-
-#ifndef TR1_MEMORY_HXX
-#define TR1_MEMORY_HXX
-
-//@@ tmp
-#define HAVE_TR1_MEMORY
-
-//
-// 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 // TR1_MEMORY_HXX