Skip to content

Commit 7bbfd45

Browse files
committed
Fix compile errors on Ubuntu 18.04 Bionic Beaver
1 parent 0e7ab27 commit 7bbfd45

3 files changed

Lines changed: 4 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ IF(UNIX)
187187
# ensure compatibility with older CPUs
188188
# enable C++11 features
189189
add_definitions(-DLINUX_BUILD)
190+
add_definitions(-D_GLIBCXX_USE_C99)
190191
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -Wall -Wno-unused-variable")
191192
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -mtune=generic -std=c++0x")
192193
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -mtune=generic")

depends/jsoncpp/jsoncpp.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3922,8 +3922,10 @@ Value& Path::make(Value& root) const {
39223922
#define isfinite finite
39233923
#else
39243924
#include <cmath>
3925+
#ifndef isfinite // fix isfinite on Ubuntu 18.04
39253926
#define isfinite std::isfinite
39263927
#endif
3928+
#endif
39273929

39283930
#if defined(_MSC_VER) && _MSC_VER < 1500 // VC++ 8.0 and below
39293931
#define snprintf _snprintf

library/MiscUtils.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ distribution.
3636
#include <ctype.h>
3737
#include <stdarg.h>
3838
#include <string.h>
39+
#include <cstdlib>
3940

4041
#include <sstream>
4142
#include <map>

0 commit comments

Comments
 (0)