FS-10036: fix windows build issues. These patches need to go upstream

This commit is contained in:
Mike Jerris
2017-03-15 16:13:40 -05:00
parent 2c368307d8
commit 70ab6964b1
2 changed files with 7 additions and 1 deletions

View File

@@ -847,7 +847,9 @@ CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value)
return cJSON_ParseWithOpts(value, 0, 0);
}
#ifndef min
#define min(a, b) ((a < b) ? a : b)
#endif
static unsigned char *print(const cJSON * const item, cjbool format, const internal_hooks * const hooks)
{
@@ -1558,10 +1560,14 @@ CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJ
{
global_hooks.deallocate(item->string);
}
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-qual"
#endif
item->string = (char*)string;
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
item->type |= cJSON_StringIsConst;
cJSON_AddItemToArray(object, item);
}