Skip to content

Commit c60983f

Browse files
committed
Merge pull request #1 from aylward/C++11Fix
BUG: Remove override, ensure gcc>4.6.3, and disable unique_ptr on apple
2 parents 9234cbb + 1acb844 commit c60983f

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ endif()
104104
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
105105
# using regular Clang or AppleClang
106106
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wconversion -Wshadow -Wno-sign-conversion")
107-
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
107+
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND GNUCXX_VERSION VERSION_GREATER 4.6.3 )
108108
# using GCC
109109
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wconversion -Wshadow -Wextra")
110110
# not yet ready for -Wsign-conversion

include/json/reader.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,9 @@ class JSON_API CharReaderBuilder : public CharReader::Factory {
333333
Json::Value settings_;
334334

335335
CharReaderBuilder();
336-
~CharReaderBuilder() override;
336+
~CharReaderBuilder();
337337

338-
CharReader* newCharReader() const override;
338+
CharReader* newCharReader() const;
339339

340340
/** \return true if 'settings' are legal and consistent;
341341
* otherwise, indicate bad settings via 'invalid'.

include/json/value.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ namespace Json {
4040
class JSON_API Exception : public std::exception {
4141
public:
4242
Exception(std::string const& msg);
43-
~Exception() throw() override;
44-
char const* what() const throw() override;
43+
~Exception() throw();
44+
char const* what() const throw();
4545
protected:
4646
std::string msg_;
4747
};

include/json/writer.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ class JSON_API StreamWriterBuilder : public StreamWriter::Factory {
112112
Json::Value settings_;
113113

114114
StreamWriterBuilder();
115-
~StreamWriterBuilder() override;
115+
~StreamWriterBuilder();
116116

117117
/**
118118
* \throw std::exception if something goes wrong (e.g. invalid settings)
119119
*/
120-
StreamWriter* newStreamWriter() const override;
120+
StreamWriter* newStreamWriter() const;
121121

122122
/** \return true if 'settings' are legal and consistent;
123123
* otherwise, indicate bad settings via 'invalid'.
@@ -158,7 +158,7 @@ class JSON_API FastWriter : public Writer {
158158

159159
public:
160160
FastWriter();
161-
~FastWriter() override {}
161+
~FastWriter() {}
162162

163163
void enableYAMLCompatibility();
164164

@@ -172,7 +172,7 @@ class JSON_API FastWriter : public Writer {
172172
void omitEndingLineFeed();
173173

174174
public: // overridden from Writer
175-
std::string write(const Value& root) override;
175+
std::string write(const Value& root);
176176

177177
private:
178178
void writeValue(const Value& value);
@@ -210,14 +210,14 @@ class JSON_API FastWriter : public Writer {
210210
class JSON_API StyledWriter : public Writer {
211211
public:
212212
StyledWriter();
213-
~StyledWriter() override {}
213+
~StyledWriter() {}
214214

215215
public: // overridden from Writer
216216
/** \brief Serialize a Value in <a HREF="http://www.json.org">JSON</a> format.
217217
* \param root Value to serialize.
218218
* \return String containing the JSON document that represents the root value.
219219
*/
220-
std::string write(const Value& root) override;
220+
std::string write(const Value& root);
221221

222222
private:
223223
void writeValue(const Value& value);

src/lib_json/json_reader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static int stackDepth_g = 0; // see readValue()
4747

4848
namespace Json {
4949

50-
#if __cplusplus >= 201103L || (defined(_CPPLIB_VER) && _CPPLIB_VER >= 520)
50+
#if ( !defined(__APPLE__) && __cplusplus >= 201103L ) || (defined(_CPPLIB_VER) && _CPPLIB_VER >= 520)
5151
typedef std::unique_ptr<CharReader> CharReaderPtr;
5252
#else
5353
typedef std::auto_ptr<CharReader> CharReaderPtr;

src/lib_json/json_writer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373

7474
namespace Json {
7575

76-
#if __cplusplus >= 201103L || (defined(_CPPLIB_VER) && _CPPLIB_VER >= 520)
76+
#if ( !defined(__APPLE__) && __cplusplus >= 201103L ) || (defined(_CPPLIB_VER) && _CPPLIB_VER >= 520)
7777
typedef std::unique_ptr<StreamWriter> StreamWriterPtr;
7878
#else
7979
typedef std::auto_ptr<StreamWriter> StreamWriterPtr;

0 commit comments

Comments
 (0)