Fossil SCM

Restore support for 64-bit integers in JSON on win32. Lost by [10666aaddd].

jan.nijtmans 2013-09-08 12:59 trunk
Commit c7409f105e80250a0239c8725903524d06bc624d
1 file changed +5 -1
--- src/cson_amalgamation.c
+++ src/cson_amalgamation.c
@@ -26,11 +26,15 @@
2626
#else
2727
# define JSON_PARSER_DLL_API
2828
#endif
2929
3030
/* Determine the integer type use to parse non-floating point numbers */
31
-#if __STDC_VERSION__ >= 199901L || HAVE_LONG_LONG == 1
31
+#ifdef _WIN32
32
+typedef __int64 JSON_int_t;
33
+#define JSON_PARSER_INTEGER_SSCANF_TOKEN "%I64d"
34
+#define JSON_PARSER_INTEGER_SPRINTF_TOKEN "%I64d"
35
+#elif __STDC_VERSION__ >= 199901L || HAVE_LONG_LONG == 1
3236
typedef long long JSON_int_t;
3337
#define JSON_PARSER_INTEGER_SSCANF_TOKEN "%lld"
3438
#define JSON_PARSER_INTEGER_SPRINTF_TOKEN "%lld"
3539
#else
3640
typedef long JSON_int_t;
3741
--- src/cson_amalgamation.c
+++ src/cson_amalgamation.c
@@ -26,11 +26,15 @@
26 #else
27 # define JSON_PARSER_DLL_API
28 #endif
29
30 /* Determine the integer type use to parse non-floating point numbers */
31 #if __STDC_VERSION__ >= 199901L || HAVE_LONG_LONG == 1
 
 
 
 
32 typedef long long JSON_int_t;
33 #define JSON_PARSER_INTEGER_SSCANF_TOKEN "%lld"
34 #define JSON_PARSER_INTEGER_SPRINTF_TOKEN "%lld"
35 #else
36 typedef long JSON_int_t;
37
--- src/cson_amalgamation.c
+++ src/cson_amalgamation.c
@@ -26,11 +26,15 @@
26 #else
27 # define JSON_PARSER_DLL_API
28 #endif
29
30 /* Determine the integer type use to parse non-floating point numbers */
31 #ifdef _WIN32
32 typedef __int64 JSON_int_t;
33 #define JSON_PARSER_INTEGER_SSCANF_TOKEN "%I64d"
34 #define JSON_PARSER_INTEGER_SPRINTF_TOKEN "%I64d"
35 #elif __STDC_VERSION__ >= 199901L || HAVE_LONG_LONG == 1
36 typedef long long JSON_int_t;
37 #define JSON_PARSER_INTEGER_SSCANF_TOKEN "%lld"
38 #define JSON_PARSER_INTEGER_SPRINTF_TOKEN "%lld"
39 #else
40 typedef long JSON_int_t;
41

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button