VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Platform/SharedPtr.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Platform/SharedPtr.h')
-rw-r--r--src/Platform/SharedPtr.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Platform/SharedPtr.h b/src/Platform/SharedPtr.h
index 29669714..f80b2167 100644
--- a/src/Platform/SharedPtr.h
+++ b/src/Platform/SharedPtr.h
@@ -1,54 +1,54 @@
/*
Derived from source code of TrueCrypt 7.1a, which is
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2017 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
code distribution packages.
*/
#ifndef TC_HEADER_Platform_SharedPtr
#define TC_HEADER_Platform_SharedPtr
#include <stdexcept>
#include <memory>
#include "SharedVal.h"
#ifdef nullptr
namespace VeraCrypt
{
-#if (__cplusplus >= 201103L)
+#if (__cplusplus >= 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X__)
#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
{
public:
explicit SharedPtr ()
: Pointer (nullptr), UseCount (nullptr) { }
explicit SharedPtr (T *pointer)
: Pointer (pointer), UseCount (new SharedVal <uint64> (1)) { }
SharedPtr (const SharedPtr &source)
{
CopyFrom (source);
}
~SharedPtr ()
{
Release();
}