From 3013ed48b333c70d5960393412a3b2c541cc97ba Mon Sep 17 00:00:00 2001 From: m-gupta Date: Mon, 16 Sep 2019 12:24:13 -0700 Subject: [PATCH] jsoncpp: Define JSON_USE_INT64_DOUBLE_CONVERSION for clang as well. (#1002) The current check to define JSON_USE_INT64_DOUBLE_CONVERSION works for GCC but not clang. Clang does define __GNUC__ but with a value 4 which misses the check for >= 6. This avoids the -Wimplicit-int-float-conversion warning when jsoncpp is built with a recent version of clang. Signed-off-by: Manoj Gupta --- include/json/config.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/json/config.h b/include/json/config.h index 6426c3b..0ff5968 100644 --- a/include/json/config.h +++ b/include/json/config.h @@ -104,7 +104,9 @@ msvc_pre1900_c99_snprintf(char* outBuf, size_t size, const char* format, ...); #define JSONCPP_OP_EXPLICIT #endif -#if defined(__GNUC__) && (__GNUC__ >= 6) +#if defined(__clang__) +#define JSON_USE_INT64_DOUBLE_CONVERSION 1 +#elif defined(__GNUC__) && (__GNUC__ >= 6) #define JSON_USE_INT64_DOUBLE_CONVERSION 1 #endif