Updated shared_ptr header to allow it to be used with clang on linux independent of runtime library

This commit is contained in:
Ian Bell
2014-08-07 19:45:01 +02:00
parent 2e38caec17
commit dedbd3dccb

View File

@@ -6,8 +6,16 @@
// Based on the platform and compiler, include the necessary header to give access to std::tr1::shared_ptr directly as shared_ptr
#if defined(__ISLINUX__) && (defined(__llvm__) || defined(__clang__)) // CLANG
#include <memory>
using std::shared_ptr;
#if __has_include(<tr1/memory>)
// CLANG and -stdlib=libstdc++
// See also http://stackoverflow.com/questions/13445742/apple-and-shared-ptr
#include <tr1/memory>
using namespace std::tr1;
#else
// CLANG and -stdlib=libc++
#include <memory>
using std::shared_ptr;
#endif
#elif defined(__ISLINUX__) // GCC
#include <tr1/memory>
using namespace std::tr1;