Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions include/json/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/lib_json/json_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/lib_json/json_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down