one definition of json_object_object_foreach only works on c99 and later

This commit is contained in:
Greg Hazel
2013-03-19 16:26:12 -07:00
parent 5ec65e43b2
commit 88bf1c9960

View 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 * @param val the local name for the json_object* object variable defined in
* the body * 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) \ # define json_object_object_foreach(obj,key,val) \
char *key; \ char *key; \
@@ -337,7 +337,7 @@ extern void json_object_object_del(struct json_object* obj, const char *key);
entry ## key) : 0); \ entry ## key) : 0); \
entry ## key = entry_next ## key) 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) /** Iterate through all keys and values of an object (ANSI C Safe)
* @param obj the json_object instance * @param obj the json_object instance