]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10036: fix windows build issues. These patches need to go upstream
authorMike Jerris <mike@jerris.com>
Wed, 15 Mar 2017 21:13:40 +0000 (16:13 -0500)
committerMike Jerris <mike@jerris.com>
Wed, 15 Mar 2017 21:13:40 +0000 (16:13 -0500)
src/cJSON.c
src/include/switch_cJSON.h

index 85709f1e3be699c73395d195b4794c2ae0166611..8cd284ebb65a58a48d098d99f53face80f302916 100644 (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);
 }
index 79dbb98157ae2ff2bfc60a83a724fbc17817d71d..37366f9e287354ef2634b7bca6368921b43f09fb 100644 (file)
@@ -141,7 +141,7 @@ CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array);
 CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int item);
 /* Get item "string" from object. Case insensitive. */
 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);
 /* 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);