(trunk libT) #2554: JSON_int_t won't use "long long int" unless STDC_VERSION is defined
This commit is contained in:
parent
c2d93776be
commit
197ccfff98
|
@ -500,7 +500,7 @@ static int parse_parse_buffer(JSON_parser jc)
|
||||||
break;
|
break;
|
||||||
case JSON_T_INTEGER:
|
case JSON_T_INTEGER:
|
||||||
arg = &value;
|
arg = &value;
|
||||||
sscanf(jc->parse_buffer, JSON_PARSER_INTEGER_SSCANF_TOKEN, &value.vu.integer_value);
|
value.vu.integer_value = evutil_strtoll( jc->parse_buffer, NULL, 10 );
|
||||||
break;
|
break;
|
||||||
case JSON_T_STRING:
|
case JSON_T_STRING:
|
||||||
arg = &value;
|
arg = &value;
|
||||||
|
|
|
@ -18,15 +18,8 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Determine the integer type use to parse non-floating point numbers */
|
/* Determine the integer type use to parse non-floating point numbers */
|
||||||
#if __STDC_VERSION__ >= 199901L || HAVE_LONG_LONG == 1
|
#include <evutil.h>
|
||||||
typedef long long JSON_int_t;
|
typedef ev_int64_t JSON_int_t;
|
||||||
#define JSON_PARSER_INTEGER_SSCANF_TOKEN "%lld"
|
|
||||||
#define JSON_PARSER_INTEGER_SPRINTF_TOKEN "%lld"
|
|
||||||
#else
|
|
||||||
typedef long JSON_int_t;
|
|
||||||
#define JSON_PARSER_INTEGER_SSCANF_TOKEN "%ld"
|
|
||||||
#define JSON_PARSER_INTEGER_SPRINTF_TOKEN "%ld"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
Loading…
Reference in New Issue