diff options
Diffstat (limited to 'glib/gmacros.h')
-rw-r--r-- | glib/gmacros.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/glib/gmacros.h b/glib/gmacros.h index cfeb9a00b..3483b2be7 100644 --- a/glib/gmacros.h +++ b/glib/gmacros.h @@ -111,6 +111,18 @@ #endif /* + * We can only use __typeof__ on GCC >= 4.8, and not when compiling C++. Since + * __typeof__ is used in a few places in GLib, provide a pre-processor symbol + * to factor the check out from callers. + * + * This symbol is private. + */ +#undef g_has_typeof +#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) && !defined(__cplusplus) +#define g_has_typeof +#endif + +/* * Clang feature detection: http://clang.llvm.org/docs/LanguageExtensions.html * These are not available on GCC, but since the pre-processor doesn't do * operator short-circuiting, we can't use it in a statement or we'll get: |