mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
Merge db98dd7e3c into cb8693b058
This commit is contained in:
10
cJSON.c
10
cJSON.c
@@ -85,6 +85,9 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define STR(s) #s
|
||||||
|
#define XSTR(s) STR(s)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const unsigned char *json;
|
const unsigned char *json;
|
||||||
size_t position;
|
size_t position;
|
||||||
@@ -121,12 +124,11 @@ 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 VERSION_NUMBER (XSTR(CJSON_VERSION_MAJOR) "." XSTR(cJSON_VERSION_MINOR) "." XSTR(cJSON_VERSION_PATCH))
|
||||||
|
|
||||||
CJSON_PUBLIC(const char*) cJSON_Version(void)
|
CJSON_PUBLIC(const char*) cJSON_Version(void)
|
||||||
{
|
{
|
||||||
static char version[15];
|
return VERSION_NUMBER;
|
||||||
sprintf(version, "%i.%i.%i", CJSON_VERSION_MAJOR, CJSON_VERSION_MINOR, 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 */
|
||||||
|
|||||||
Reference in New Issue
Block a user