Skip to content

Commit 9b53c92

Browse files
committed
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.
1 parent 5b15c75 commit 9b53c92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

json_object.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ JSON_EXPORT void json_object_object_del(struct json_object *obj, const char *key
452452
* @param val the local name for the json_object* object variable defined in
453453
* the body
454454
*/
455-
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && __STDC_VERSION__ >= 199901L
455+
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
456456

457457
#define json_object_object_foreach(obj, key, val) \
458458
char *key = NULL; \
@@ -484,7 +484,7 @@ JSON_EXPORT void json_object_object_del(struct json_object *obj, const char *key
484484
: 0); \
485485
entry##key = entry_next##key)
486486

487-
#endif /* defined(__GNUC__) && !defined(__STRICT_ANSI__) && __STDC_VERSION__ >= 199901L */
487+
#endif /* defined(__GNUC__) && !defined(__STRICT_ANSI__) && (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) */
488488

489489
/** Iterate through all keys and values of an object (ANSI C Safe)
490490
* @param obj the json_object instance

0 commit comments

Comments
 (0)