Skip to content

Commit 3013ed4

Browse files
m-guptabaylesj
authored andcommitted
jsoncpp: Define JSON_USE_INT64_DOUBLE_CONVERSION for clang as well. (open-source-parsers#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 <[email protected]>
1 parent 2cb9a58 commit 3013ed4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/json/config.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ msvc_pre1900_c99_snprintf(char* outBuf, size_t size, const char* format, ...);
104104
#define JSONCPP_OP_EXPLICIT
105105
#endif
106106

107-
#if defined(__GNUC__) && (__GNUC__ >= 6)
107+
#if defined(__clang__)
108+
#define JSON_USE_INT64_DOUBLE_CONVERSION 1
109+
#elif defined(__GNUC__) && (__GNUC__ >= 6)
108110
#define JSON_USE_INT64_DOUBLE_CONVERSION 1
109111
#endif
110112

0 commit comments

Comments
 (0)