__cplusplus value should not be used to decide for std::unique_ptr #350:
authordrgler <daniel.kruegler@gmail.com>
Sun, 6 Sep 2015 14:13:06 +0000 (16:13 +0200)
committerdrgler <daniel.kruegler@gmail.com>
Sun, 27 Sep 2015 12:03:35 +0000 (14:03 +0200)
In addition to the C++ language version define __cplusplus also check _CPPLIB_VER for better Dinkumware support.

src/lib_json/json_reader.cpp
src/lib_json/json_writer.cpp

index ade7890..c98b000 100644 (file)
@@ -43,7 +43,7 @@ static int       stackDepth_g = 0;  // see readValue()
 
 namespace Json {
 
-#if __cplusplus >= 201103L
+#if __cplusplus >= 201103L || (defined(_CPPLIB_VER) && _CPPLIB_VER >= 520)
 typedef std::unique_ptr<CharReader> CharReaderPtr;
 #else
 typedef std::auto_ptr<CharReader>   CharReaderPtr;
index f4f1b7f..c85907a 100644 (file)
@@ -54,7 +54,7 @@
 
 namespace Json {
 
-#if __cplusplus >= 201103L
+#if __cplusplus >= 201103L || (defined(_CPPLIB_VER) && _CPPLIB_VER >= 520)
 typedef std::unique_ptr<StreamWriter> StreamWriterPtr;
 #else
 typedef std::auto_ptr<StreamWriter>   StreamWriterPtr;