Browse Source

Check __STDC_VERSION__ is defined before checking its value

Prevent an undef warning regarding __STDC_VERSION__ by checking whether it is defined before checking its value.
tags/json-c-0.16-20220414
David McCann 4 years ago
parent
commit
9b53c92ea3
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      json_object.h

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


Loading…
Cancel
Save