Skip to content

Commit 54764dd

Browse files
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.
1 parent 8dd32e1 commit 54764dd

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/lib_json/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ ELSE(JSONCPP_LIB_BUILD_SHARED)
1010
SET(JSONCPP_LIB_TYPE STATIC)
1111
ENDIF(JSONCPP_LIB_BUILD_SHARED)
1212

13-
1413
if( CMAKE_COMPILER_IS_GNUCXX )
1514
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=strict-aliasing")
1615
endif( CMAKE_COMPILER_IS_GNUCXX )

src/lib_json/json_writer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
#pragma warning(disable : 4996)
2727
#endif
2828

29+
#if defined(__sun) && defined(__SVR4) //Solaris
30+
#include <ieeefp.h>
31+
#define isfinite finite
32+
#endif
33+
2934
namespace Json {
3035

3136
static bool containsControlCharacter(const char* str) {

0 commit comments

Comments
 (0)