From 836cf237cf2e877e1841d69ade8248a9ddc54139 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Mon, 27 Jul 2015 16:46:25 -0400 Subject: Fixed compile error due to MS using _MSC_VER rather than __cplusplus --- smartptr.h | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'smartptr.h') diff --git a/smartptr.h b/smartptr.h index daa53255..0ec83be2 100644 --- a/smartptr.h +++ b/smartptr.h @@ -2,12 +2,30 @@ #define CRYPTOPP_SMARTPTR_H #include "config.h" +#include "stdcpp.h" #include "trap.h" -#include - NAMESPACE_BEGIN(CryptoPP) +// This must be kept in sync with stdcpp.h because is included based on the same logic. +#if ((__cplusplus >= 201103L) || (_MSC_VER >= 1600)) && !defined(__clang__) +# include + template + using auto_ptr = std::unique_ptr; +#elif defined(__clang__) +# if (__has_include()) +# include + using std::auto_ptr; +# endif +#elif (__cplusplus < 201103L) +# include + using std::auto_ptr; +#else +# include + template + using auto_ptr = std::unique_ptr; +#endif + template class simple_ptr { public: -- cgit v1.2.1