mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-04-22 00:30:11 +02: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
|
#define JSON_API
|
||||||
#endif
|
#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
|
// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for
|
||||||
// integer
|
// integer
|
||||||
// Storages, and 64 bits integer support is disabled.
|
// Storages, and 64 bits integer support is disabled.
|
||||||
|
@ -43,8 +43,8 @@ static int stackDepth_g = 0; // see readValue()
|
|||||||
|
|
||||||
namespace Json {
|
namespace Json {
|
||||||
|
|
||||||
#if __GNUC__ >= 6
|
#if JSON_HAS_UNIQUE_PTR
|
||||||
typedef std::scoped_ptr<CharReader> const CharReaderPtr;
|
typedef std::unique_ptr<CharReader> const CharReaderPtr;
|
||||||
#else
|
#else
|
||||||
typedef std::auto_ptr<CharReader> CharReaderPtr;
|
typedef std::auto_ptr<CharReader> CharReaderPtr;
|
||||||
#endif
|
#endif
|
||||||
|
@ -54,8 +54,8 @@
|
|||||||
|
|
||||||
namespace Json {
|
namespace Json {
|
||||||
|
|
||||||
#if __GNUC__ >= 6
|
#if JSON_HAS_UNIQUE_PTR
|
||||||
typedef std::scoped_ptr<StreamWriter> const StreamWriterPtr;
|
typedef std::unique_ptr<StreamWriter> const StreamWriterPtr;
|
||||||
#else
|
#else
|
||||||
typedef std::auto_ptr<StreamWriter> StreamWriterPtr;
|
typedef std::auto_ptr<StreamWriter> StreamWriterPtr;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user