fix error C2124 in visual studio

This commit is contained in:
Alanscut 2020-04-02 23:32:30 +08:00
parent 23e4fbc639
commit 5d55c6c2ee
1 changed files with 5 additions and 1 deletions

View File

@ -77,6 +77,10 @@
#define isnan(d) (d != d) #define isnan(d) (d != d)
#endif #endif
#ifndef NAN
#define NAN 0.0/0.0
#endif
typedef struct { typedef struct {
const unsigned char *json; const unsigned char *json;
size_t position; size_t position;
@ -102,7 +106,7 @@ CJSON_PUBLIC(double) cJSON_GetNumberValue(cJSON *item)
{ {
if (!cJSON_IsNumber(item)) if (!cJSON_IsNumber(item))
{ {
return 0.0/0.0; return NAN;
} }
return item->valuedouble; return item->valuedouble;