Long long ints: optional compile choice

This commit is contained in:
No Default Name 2022-04-24 16:47:29 +02:00
parent ec898e0143
commit 3506c17e57
2 changed files with 4 additions and 2 deletions

View File

@ -70,7 +70,7 @@
#define false ((cJSON_bool)0)
/* define our own int max and min */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#if defined(CJSON_INT_USE_LONGLONG) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define CJSON_INT_MAX LLONG_MAX
#define CJSON_INT_MIN LLONG_MIN
#define strtoint(s) strtoll((const char*)(s), NULL, 0)

View File

@ -99,7 +99,9 @@ then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJ
#define cJSON_IsReference 256
#define cJSON_StringIsConst 512
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define notCJSON_INT_USE_LONGLONG
#if defined(CJSON_INT_USE_LONGLONG) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
typedef long long cJSON_int;
#else
typedef int cJSON_int;