Skip to content

Commit

Permalink
Merge pull request #1394 from mavlink/fix-jsoncpp-android-ndk22
Browse files Browse the repository at this point in the history
Fix jsoncpp Werror with NDK r22b
  • Loading branch information
JonasVautherin authored Apr 8, 2021
2 parents cfabcfe + 2d026f6 commit ebb69db
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion third_party/jsoncpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ ExternalProject_Add(
GIT_REPOSITORY https://github.com/open-source-parsers/jsoncpp
GIT_TAG 1.8.4
PREFIX jsoncpp
PATCH_COMMAND git checkout . && git apply ${PROJECT_SOURCE_DIR}/fixlibname.patch
PATCH_COMMAND git checkout . && git apply ${PROJECT_SOURCE_DIR}/fixlibname.patch && git apply ${PROJECT_SOURCE_DIR}/fix_werror.patch
CMAKE_ARGS "${CMAKE_ARGS}"
)
14 changes: 14 additions & 0 deletions third_party/jsoncpp/fix_werror.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp
index 91d4802..62b9475 100644
--- a/src/lib_json/json_value.cpp
+++ b/src/lib_json/json_value.cpp
@@ -69,8 +69,7 @@ template <typename T, typename U>
static inline bool InRange(double d, T min, U max) {
// The casts can lose precision, but we are looking only for
// an approximate range. Might fail on edge cases though. ~cdunn
- //return d >= static_cast<double>(min) && d <= static_cast<double>(max);
- return d >= min && d <= max;
+ return d >= static_cast<double>(min) && d <= static_cast<double>(max);
}
#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
static inline double integerToDouble(Json::UInt64 value) {

0 comments on commit ebb69db

Please sign in to comment.