* @param val the local name for the json_object* object variable defined in
* the body
*/
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && (defined(__cplusplus) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L))
#define json_object_object_foreach(obj, key, val) \
char *key = NULL; \
: 0); \
entry##key = entry_next##key)
-#endif /* defined(__GNUC__) && !defined(__STRICT_ANSI__) && (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) */
+#endif
/** Iterate through all keys and values of an object (ANSI C Safe)
* @param obj the json_object instance
/**
* @deprecated Don't use this outside of linkhash.h:
*/
-#if !defined (__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
+#if !defined(__cplusplus) && (!defined (__STDC_VERSION__) || (__STDC_VERSION__ < 199901L))
/* C89 compilers like VS2010 can't handle inline funcs, so skip it there,
note: this also applies to -std=c89 in GCC! */
#define _LH_INLINE