mirror of
https://github.com/transmission/transmission
synced 2024-12-25 09:13:06 +00:00
(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
2 changed files with 3 additions and 10 deletions
|
@ -500,7 +500,7 @@ static int parse_parse_buffer(JSON_parser jc)
|
|||
break;
|
||||
case JSON_T_INTEGER:
|
||||
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;
|
||||
case JSON_T_STRING:
|
||||
arg = &value;
|
||||
|
|
|
@ -18,15 +18,8 @@
|
|||
#endif
|
||||
|
||||
/* Determine the integer type use to parse non-floating point numbers */
|
||||
#if __STDC_VERSION__ >= 199901L || HAVE_LONG_LONG == 1
|
||||
typedef long long 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
|
||||
#include <evutil.h>
|
||||
typedef ev_int64_t JSON_int_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Reference in a new issue