mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-12 03:18:26 -06:00
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
This commit is contained in:
@@ -14,12 +14,25 @@
|
||||
#define TC_HEADER_Platform_SharedPtr
|
||||
|
||||
#include <stdexcept>
|
||||
#include <memory>
|
||||
#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 T>
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user