From 5fb407cffebb8ec0cc50cb3e96e1bebf79ad1bc0 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Fri, 26 Jun 2020 01:18:40 +0200 Subject: Linux/MacOSX: use standard std::shared_ptr instead of our custom implementation which is kept for compatibility with older compilers. We also introduce compatibility code for old compilers that don't define std::unique_ptr --- src/Platform/SharedPtr.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/Platform') diff --git a/src/Platform/SharedPtr.h b/src/Platform/SharedPtr.h index 7675c2a5..29669714 100644 --- a/src/Platform/SharedPtr.h +++ b/src/Platform/SharedPtr.h @@ -14,12 +14,25 @@ #define TC_HEADER_Platform_SharedPtr #include +#include #include "SharedVal.h" #ifdef nullptr namespace VeraCrypt { +#if (__cplusplus >= 201103L) + #define VC_USE_NATIVE_PTR 1 +#endif + +#ifdef VC_USE_NATIVE_PTR + +#define shared_ptr std::shared_ptr +#define make_shared std::make_shared +#define move_ptr std::move + +#else + template class SharedPtr { @@ -157,6 +170,10 @@ namespace VeraCrypt #define make_shared VeraCrypt::make_shared +#define unique_ptr auto_ptr +#define move_ptr(p) p + +#endif } #endif // nullptr -- cgit v1.2.3