mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-01-14 01:47:54 +08:00
Merge pull request #604 from AbigailBuccaneer/gcc6-unique-ptr
Use std::unique_ptr correctly across compiler and language versions
This commit is contained in:
commit
3cde9a9912
@ -51,6 +51,16 @@
|
||||
#define JSON_API
|
||||
#endif
|
||||
|
||||
#if !defined(JSON_HAS_UNIQUE_PTR)
|
||||
#if __cplusplus >= 201103L
|
||||
#define JSON_HAS_UNIQUE_PTR (1)
|
||||
#elif _MSC_VER >= 1600
|
||||
#define JSON_HAS_UNIQUE_PTR (1)
|
||||
#else
|
||||
#define JSON_HAS_UNIQUE_PTR (0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for
|
||||
// integer
|
||||
// Storages, and 64 bits integer support is disabled.
|
||||
|
@ -43,8 +43,8 @@ static int stackDepth_g = 0; // see readValue()
|
||||
|
||||
namespace Json {
|
||||
|
||||
#if __GNUC__ >= 6
|
||||
typedef std::scoped_ptr<CharReader> const CharReaderPtr;
|
||||
#if JSON_HAS_UNIQUE_PTR
|
||||
typedef std::unique_ptr<CharReader> const CharReaderPtr;
|
||||
#else
|
||||
typedef std::auto_ptr<CharReader> CharReaderPtr;
|
||||
#endif
|
||||
|
@ -54,8 +54,8 @@
|
||||
|
||||
namespace Json {
|
||||
|
||||
#if __GNUC__ >= 6
|
||||
typedef std::scoped_ptr<StreamWriter> const StreamWriterPtr;
|
||||
#if JSON_HAS_UNIQUE_PTR
|
||||
typedef std::unique_ptr<StreamWriter> const StreamWriterPtr;
|
||||
#else
|
||||
typedef std::auto_ptr<StreamWriter> StreamWriterPtr;
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user