mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
Make version number go into ROM to save RAM :)
This commit is contained in:
parent
d2735278ed
commit
cf877f4553
10
cJSON.c
10
cJSON.c
@ -81,6 +81,9 @@
|
||||
#define NAN 0.0/0.0
|
||||
#endif
|
||||
|
||||
#define STR(s) #s
|
||||
#define XSTR(s) STR(s)
|
||||
|
||||
typedef struct {
|
||||
const unsigned char *json;
|
||||
size_t position;
|
||||
@ -117,12 +120,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.
|
||||
#endif
|
||||
|
||||
#define VERSION_NUMBER (XSTR(CJSON_VERSION_MAJOR) "." XSTR(cJSON_VERSION_MINOR) "." XSTR(cJSON_VERSION_PATCH"))
|
||||
|
||||
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 VERSION_NUMBER;
|
||||
}
|
||||
|
||||
/* Case insensitive string comparison, doesn't consider two NULL pointers equal though */
|
||||
|
Loading…
Reference in New Issue
Block a user