]> git.ipfire.org Git - thirdparty/json-c.git/commitdiff
one definition of json_object_object_foreach only works on c99 and later 73/head
authorGreg Hazel <ghazel@gmail.com>
Tue, 19 Mar 2013 23:26:12 +0000 (16:26 -0700)
committerGreg Hazel <ghazel@gmail.com>
Tue, 19 Mar 2013 23:26:12 +0000 (16:26 -0700)
json_object.h

index 7085d0af9ce06a8c5c21662cd5b6975dca72228c..627030926d19b9deac29f600a65b51ed46f13f17 100644 (file)
@@ -309,7 +309,7 @@ extern 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__)
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && __STDC_VERSION__ >= 199901L
 
 # define json_object_object_foreach(obj,key,val) \
        char *key; \
@@ -337,7 +337,7 @@ extern void json_object_object_del(struct json_object* obj, const char *key);
                        entry ## key) : 0); \
                entry ## key = entry_next ## key)
 
-#endif /* defined(__GNUC__) && !defined(__STRICT_ANSI__) */
+#endif /* defined(__GNUC__) && !defined(__STRICT_ANSI__) && __STDC_VERSION__ >= 199901L */
 
 /** Iterate through all keys and values of an object (ANSI C Safe)
  * @param obj the json_object instance