Fix: Check if __GNUCC__ is defined

This has been detected via MSVC's Warning C4668
This commit is contained in:
Max Bruckner 2017-06-17 15:04:29 +02:00
parent e174831819
commit 7a2615c231

View File

@ -1849,7 +1849,7 @@ CJSON_PUBLIC(void) cJSON_AddItemToObject(cJSON *object, const char *string, cJSO
item->type &= ~cJSON_StringIsConst; item->type &= ~cJSON_StringIsConst;
} }
#if defined (__clang__) || ((__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) #if defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5))))
#pragma GCC diagnostic push #pragma GCC diagnostic push
#endif #endif
#ifdef __GNUC__ #ifdef __GNUC__
@ -1871,7 +1871,7 @@ CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJ
item->type |= cJSON_StringIsConst; item->type |= cJSON_StringIsConst;
cJSON_AddItemToArray(object, item); cJSON_AddItemToArray(object, item);
} }
#if defined (__clang__) || ((__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) #if defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5))))
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#endif #endif