From 88bf1c996013f2f733a3b21822aa73669eb8cdf5 Mon Sep 17 00:00:00 2001 From: Greg Hazel Date: Tue, 19 Mar 2013 16:26:12 -0700 Subject: [PATCH] one definition of json_object_object_foreach only works on c99 and later --- json_object.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/json_object.h b/json_object.h index 7085d0af..62703092 100644 --- a/json_object.h +++ b/json_object.h @@ -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 -- 2.39.5