diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-12-09 10:36:15 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-12-09 10:36:15 +0200 |
commit | 68ca8ec3227d447c6898b7c75d8ea0fb82a4af36 (patch) | |
tree | 93d2afa8e23238a87b0b2eb2f702e1910a11fb6b /common/lazy-ptr/tr1-memory.hxx | |
parent | 0b4c59824e3b2b0411dd33835c67f6cd36d60a91 (diff) |
Add lazy pointer support
Built-in support is provided for raw, auto, and tr1 shared/weak pointers.
New test: common/lazy-ptr.
Diffstat (limited to 'common/lazy-ptr/tr1-memory.hxx')
-rw-r--r-- | common/lazy-ptr/tr1-memory.hxx | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/common/lazy-ptr/tr1-memory.hxx b/common/lazy-ptr/tr1-memory.hxx new file mode 100644 index 0000000..8965861 --- /dev/null +++ b/common/lazy-ptr/tr1-memory.hxx @@ -0,0 +1,41 @@ +// file : common/lazy-ptr/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 |