Skip to content

Commit 4eeafbc

Browse files
committed
Merge pull request #101 from dominicpezzuto/master
Fix build issues related to Solaris and older GCC
2 parents 15949af + 250bd9a commit 4eeafbc

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/lib_json/CMakeLists.txt

+8-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ ELSE(JSONCPP_LIB_BUILD_SHARED)
66
SET(JSONCPP_LIB_TYPE STATIC)
77
ENDIF(JSONCPP_LIB_BUILD_SHARED)
88

9-
109
if( CMAKE_COMPILER_IS_GNUCXX )
11-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=strict-aliasing")
10+
#Get compiler version.
11+
execute_process( COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
12+
OUTPUT_VARIABLE GNUCXX_VERSION )
13+
14+
#-Werror=* was introduced -after- GCC 4.1.2
15+
if( GNUCXX_VERSION VERSION_GREATER 4.1.2 )
16+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=strict-aliasing")
17+
endif()
1218
endif( CMAKE_COMPILER_IS_GNUCXX )
1319

1420
SET( JSONCPP_INCLUDE_DIR ../../include )

src/lib_json/json_writer.cpp

+5
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)