Compare commits

...

6 Commits
1.8.2 ... 0.7.1

Author SHA1 Message Date
Christopher Dunn
4eeafbcc6b Merge pull request #101 from dominicpezzuto/master
Fix build issues related to Solaris and older GCC
2015-01-06 13:08:34 -06:00
dominicpezzuto
250bd9a00f Fix build issues related to Solaris and older GCC
Fixed two build issues:
 - JsonCPP currently doesn’t compile for Solaris due to platform
differences with ‘isfinite’ function.  Fixed by adding proper include
and define for Solaris.
 - JsonCPP currently doesn’t compile for GCC version 4.1.2 and earlier
due to use of ‘-Werror=*’ compile flag, which was introduced in a later
version.  Fixed by adding version check to only add this flag on
supported versions of GCC.
2015-01-06 13:07:19 -06:00
dominicpezzuto
abd1bb0709 Fix build issues related to Solaris and older GCC
Fixed two build issues:
 - JsonCPP currently doesn’t compile for Solaris due to platform
differences with ‘isfinite’ function.  Fixed by adding proper include
and define for Solaris.
 - JsonCPP currently doesn’t compile for GCC version 4.1.2 and earlier
due to use of ‘-Werror=*’ compile flag, which was introduced in a later
version.  Fixed by adding version check to only add this flag on
supported versions of GCC.
2015-01-06 13:07:19 -06:00
Christopher Dunn
15949af098 0.7.0 2014-11-20 08:48:22 -06:00
Christopher Dunn
8dc52b3cca 0.7.0 2014-11-20 00:18:47 -06:00
Christopher Dunn
add941c1a9 Revert "Switch to copy-and-swap idiom for operator=."
This reverts commit 45cd9490cd.

Ignored ValueInternal* changes, since those did not produce symbols for
Debian build. (They must not have used the INTERNAL stuff.)

  https://github.com/open-source-parsers/jsoncpp/issues/78

Conflicts:
	include/json/value.h
	src/lib_json/json_internalarray.inl
	src/lib_json/json_internalmap.inl
	src/lib_json/json_value.cpp
2014-11-17 00:16:39 -06:00
5 changed files with 22 additions and 9 deletions

View File

@@ -171,7 +171,7 @@ private:
CZString(const char* cstr, DuplicationPolicy allocate);
CZString(const CZString& other);
~CZString();
CZString& operator=(CZString other);
CZString &operator=(const CZString &other);
bool operator<(const CZString& other) const;
bool operator==(const CZString& other) const;
ArrayIndex index() const;
@@ -238,7 +238,7 @@ Json::Value obj_value(Json::objectValue); // {}
Value(const Value& other);
~Value();
Value& operator=(Value other);
Value &operator=(const Value &other);
/// Swap values.
/// \note Currently, comments are intentionally not swapped, for
/// both logic and efficiency.

View File

@@ -6,9 +6,15 @@ ELSE(JSONCPP_LIB_BUILD_SHARED)
SET(JSONCPP_LIB_TYPE STATIC)
ENDIF(JSONCPP_LIB_BUILD_SHARED)
if( CMAKE_COMPILER_IS_GNUCXX )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=strict-aliasing")
#Get compiler version.
execute_process( COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
OUTPUT_VARIABLE GNUCXX_VERSION )
#-Werror=* was introduced -after- GCC 4.1.2
if( GNUCXX_VERSION VERSION_GREATER 4.1.2 )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=strict-aliasing")
endif()
endif( CMAKE_COMPILER_IS_GNUCXX )
SET( JSONCPP_INCLUDE_DIR ../../include )

View File

@@ -188,8 +188,9 @@ void Value::CZString::swap(CZString& other) {
std::swap(index_, other.index_);
}
Value::CZString& Value::CZString::operator=(CZString other) {
swap(other);
Value::CZString &Value::CZString::operator=(const CZString &other) {
CZString temp(other);
swap(temp);
return *this;
}
@@ -478,8 +479,9 @@ Value::~Value() {
delete[] comments_;
}
Value& Value::operator=(Value other) {
swap(other);
Value &Value::operator=(const Value &other) {
Value temp(other);
swap(temp);
return *this;
}

View File

@@ -26,6 +26,11 @@
#pragma warning(disable : 4996)
#endif
#if defined(__sun) && defined(__SVR4) //Solaris
#include <ieeefp.h>
#define isfinite finite
#endif
namespace Json {
static bool containsControlCharacter(const char* str) {