Skip to content

Commit

Permalink
fix error C2124 in visual studio
Browse files Browse the repository at this point in the history
  • Loading branch information
Alanscut committed Apr 2, 2020
1 parent 23e4fbc commit 5d55c6c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cJSON.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@
#define isnan(d) (d != d)
#endif

#ifndef NAN
#define NAN 0.0/0.0
#endif

typedef struct {
const unsigned char *json;
size_t position;
Expand All @@ -102,7 +106,7 @@ CJSON_PUBLIC(double) cJSON_GetNumberValue(cJSON *item)
{
if (!cJSON_IsNumber(item))
{
return 0.0/0.0;
return NAN;
}

return item->valuedouble;
Expand Down

0 comments on commit 5d55c6c

Please sign in to comment.