I'm not sure if it should be checking gcc >= 3.0 or 3.3, but they're
all old so doesn't really matter.
The __cplusplus check was added to both, since it wouldn't have done
anything anyway as COMPILE_ERROR_IF_TRUE() is 0 for __cplusplus.
# define LLONG_MAX 9223372036854775807LL
#endif
+#if ((__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3)) && \
+ defined(HAVE_TYPEOF)) && !defined(__cplusplus)
+# define HAVE_TYPE_CHECKS
+#endif
+
/* We really want NULL to be a pointer, since we have various type-checks
that may result in compiler warnings/errors if it's not. */
#ifndef __cplusplus
#endif
/* Macros to provide type safety for callback functions' context parameters */
-#if ((__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3)) && defined(HAVE_TYPEOF))
+#ifdef HAVE_TYPE_CHECKS
# define CALLBACK_TYPECHECK(callback, type) \
(COMPILE_ERROR_IF_TRUE(!__builtin_types_compatible_p( \
typeof(&callback), type)) ? 1 : 0)
# define COMPILE_ERROR_IF_TRUE(condition) 0
#endif
-#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)) && !defined(__cplusplus) && defined(HAVE_TYPEOF)
+#ifdef HAVE_TYPE_CHECKS
# define COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(_a, _b) \
COMPILE_ERROR_IF_TRUE( \
!__builtin_types_compatible_p(typeof(_a), typeof(_b)))