mirror of
https://github.com/DaveGamble/cJSON
synced 2025-04-29 14:47:55 +00:00
Merge d34dda6d6e
into 12c4bf1986
This commit is contained in:
commit
32e2cd57a7
9
cJSON.c
9
cJSON.c
@ -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.
|
#error cJSON.h and cJSON.c have different versions. Make sure that both have the same.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define STRINGIFY_(s) #s
|
||||||
|
#define STRINGIFY(s) STRINGIFY_(s)
|
||||||
|
|
||||||
CJSON_PUBLIC(const char*) cJSON_Version(void)
|
CJSON_PUBLIC(const char*) cJSON_Version(void)
|
||||||
{
|
{
|
||||||
static char version[15];
|
return STRINGIFY(CJSON_VERSION_MAJOR) "." STRINGIFY(CJSON_VERSION_MINOR) "." \
|
||||||
sprintf(version, "%i.%i.%i", CJSON_VERSION_MAJOR, CJSON_VERSION_MINOR, CJSON_VERSION_PATCH);
|
STRINGIFY(CJSON_VERSION_PATCH);
|
||||||
|
|
||||||
return version;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Case insensitive string comparison, doesn't consider two NULL pointers equal though */
|
/* Case insensitive string comparison, doesn't consider two NULL pointers equal though */
|
||||||
|
Loading…
Reference in New Issue
Block a user