Commit 39c9dca3 authored by Jan Möbius's avatar Jan Möbius

We don't need to break beakward compatibility here

parent 09f60ead
Pipeline #3594 failed with stage
in 34 minutes and 6 seconds
......@@ -52,22 +52,76 @@
#include <memory>
// legacy code may depend on this define:
#define ACG_UNIQUE_POINTER_SUPPORTED 1
// Default for C++ 11 and higher
#if ((defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__))
namespace ptr {
using std::shared_ptr;
using std::make_shared;
using std::unique_ptr;
#if __cplusplus >= 201402L
// legacy code may depend on this define:
#define ACG_UNIQUE_POINTER_SUPPORTED 1
namespace ptr {
using std::shared_ptr;
using std::make_shared;
using std::unique_ptr;
#if __cplusplus >= 201402L
using std::make_unique;
#else
#else
template<typename T, typename... Args>
std::unique_ptr<T>
make_unique(Args&&... args) {
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
#endif // C++14
#endif // C++14
#else // deprecated things
/** This set of defines maps the pointer namespaces to the namespace ptr depending on
* the current architecture and compilers.
*/
#if ( (__cplusplus >= 201103L) || (__STDC_VERSION__ >= 201112L) )
// C++11:
#include <memory>
namespace ptr = std;
#define ACG_UNIQUE_POINTER_SUPPORTED 1
#elif defined(__GXX_EXPERIMENTAL_CXX0X__)
// C++11 via -std=c++0x on gcc:
#include <memory>
namespace ptr = std;
#define ACG_UNIQUE_POINTER_SUPPORTED 1
#else
// C++98 and TR1:
#if (_MSC_VER >= 1600)
// VStudio 2010 supports some C++11 features
#include <memory>
namespace ptr = std;
#define ACG_UNIQUE_POINTER_SUPPORTED 1
#elif (_MSC_VER >= 1500)
// hope for TR1 equivalents
#if(_HAS_TR1)
#include <memory>
namespace ptr = std::tr1;
#define ACG_UNIQUE_POINTER_SUPPORTED 0
#else
#pragma warning "TR1 not available! Please install Visual Studio Service Pack 1!"
#endif
#else
// hope for TR1 equivalents
// check for clang5 but switch to tr1 if clang uses libstdc++
#if defined(__clang_major__) && (__clang_major__ >= 5) && !defined(__GLIBCXX__ )
// Mavericks special treatment
#include <memory>
namespace ptr = std;
#else
#include <tr1/memory>
namespace ptr = std::tr1;
#endif
#define ACG_UNIQUE_POINTER_SUPPORTED 0
#endif
#endif
#endif
} // namespace ptr
#endif // ACG_UTILS_SMARTPOINTER_HH
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment