]> git.ipfire.org Git - thirdparty/json-c.git/commitdiff
Check __STDC_VERSION__ is defined before checking its value
authorDavid McCann <mccannd@uk.ibm.com>
Thu, 13 May 2021 05:31:18 +0000 (06:31 +0100)
committerDavid McCann <mccannd@uk.ibm.com>
Thu, 13 May 2021 05:31:18 +0000 (06:31 +0100)
Prevent an undef warning regarding __STDC_VERSION__ by checking whether it is defined before checking its value.

json_object.h

index 7c0d1f2056bc26bdac59ea2d00ae488a8af8bb18..be6919a5d2833d6bcf7e63b61588f6428e8bb505 100644 (file)
@@ -452,7 +452,7 @@ JSON_EXPORT void json_object_object_del(struct json_object *obj, const char *key
  * @param val the local name for the json_object* object variable defined in
  *            the body
  */
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && __STDC_VERSION__ >= 199901L
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
 
 #define json_object_object_foreach(obj, key, val)                                \
        char *key = NULL;                                                        \
@@ -484,7 +484,7 @@ JSON_EXPORT void json_object_object_del(struct json_object *obj, const char *key
                         : 0);                                                 \
             entry##key = entry_next##key)
 
-#endif /* defined(__GNUC__) && !defined(__STRICT_ANSI__) && __STDC_VERSION__ >= 199901L */
+#endif /* defined(__GNUC__) && !defined(__STRICT_ANSI__) && (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) */
 
 /** Iterate through all keys and values of an object (ANSI C Safe)
  * @param obj the json_object instance