From 54764dd85b6be0b866ac780f45eb0cc4d2202222 Mon Sep 17 00:00:00 2001 From: dominicpezzuto Date: Sat, 27 Dec 2014 16:44:26 -0500 Subject: [PATCH] Fix build issues related to Solaris and older GCC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/lib_json/CMakeLists.txt | 1 - src/lib_json/json_writer.cpp | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib_json/CMakeLists.txt b/src/lib_json/CMakeLists.txt index e395c64..3bf5e1a 100644 --- a/src/lib_json/CMakeLists.txt +++ b/src/lib_json/CMakeLists.txt @@ -10,7 +10,6 @@ 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") endif( CMAKE_COMPILER_IS_GNUCXX ) diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp index 89964ea..280f09e 100644 --- a/src/lib_json/json_writer.cpp +++ b/src/lib_json/json_writer.cpp @@ -26,6 +26,11 @@ #pragma warning(disable : 4996) #endif +#if defined(__sun) && defined(__SVR4) //Solaris +#include +#define isfinite finite +#endif + namespace Json { static bool containsControlCharacter(const char* str) {