1
0
mirror of https://github.com/DaveGamble/cJSON synced 2025-04-27 13:47:55 +00:00
This commit is contained in:
niooss-ledger 2024-09-23 15:21:43 -07:00 committed by GitHub
commit 32e2cd57a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -121,12 +121,13 @@ CJSON_PUBLIC(double) cJSON_GetNumberValue(const cJSON * const item)
#error cJSON.h and cJSON.c have different versions. Make sure that both have the same.
#endif
#define STRINGIFY_(s) #s
#define STRINGIFY(s) STRINGIFY_(s)
CJSON_PUBLIC(const char*) cJSON_Version(void)
{
static char version[15];
sprintf(version, "%i.%i.%i", CJSON_VERSION_MAJOR, CJSON_VERSION_MINOR, CJSON_VERSION_PATCH);
return version;
return STRINGIFY(CJSON_VERSION_MAJOR) "." STRINGIFY(CJSON_VERSION_MINOR) "." \
STRINGIFY(CJSON_VERSION_PATCH);
}
/* Case insensitive string comparison, doesn't consider two NULL pointers equal though */