提交 70ab6964 authored 作者: Mike Jerris's avatar Mike Jerris

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

上级 2c368307
...@@ -847,7 +847,9 @@ CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value) ...@@ -847,7 +847,9 @@ CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value)
return cJSON_ParseWithOpts(value, 0, 0); return cJSON_ParseWithOpts(value, 0, 0);
} }
#ifndef min
#define min(a, b) ((a < b) ? a : b) #define min(a, b) ((a < b) ? a : b)
#endif
static unsigned char *print(const cJSON * const item, cjbool format, const internal_hooks * const hooks) 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 ...@@ -1558,10 +1560,14 @@ CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJ
{ {
global_hooks.deallocate(item->string); global_hooks.deallocate(item->string);
} }
#ifdef __GNUC__
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-qual" #pragma GCC diagnostic ignored "-Wcast-qual"
#endif
item->string = (char*)string; item->string = (char*)string;
#ifdef __GNUC__
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#endif
item->type |= cJSON_StringIsConst; item->type |= cJSON_StringIsConst;
cJSON_AddItemToArray(object, item); cJSON_AddItemToArray(object, item);
} }
......
...@@ -141,7 +141,7 @@ CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array); ...@@ -141,7 +141,7 @@ CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array);
CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int item); CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int item);
/* Get item "string" from object. Case insensitive. */ /* Get item "string" from object. Case insensitive. */
CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON *object, const char *string); CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON *object, const char *string);
CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON *object, const char *string); CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string);
CJSON_PUBLIC(int) cJSON_HasObjectItem(const cJSON *object, const char *string); CJSON_PUBLIC(int) cJSON_HasObjectItem(const cJSON *object, const char *string);
/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */ /* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */
CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void); CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论