From c236842241f9fcfff3274d8b1b7b1f365dc9227f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Thu, 15 Mar 2012 11:37:02 +0100 Subject: Use clang's builtin is_enum, if available Change-Id: Ie0c32b8fd6d3bb02cf6c6b626bb31d57cdcdf497 Reviewed-by: Bradley T. Hughes Reviewed-by: Glenn Watson --- src/corelib/global/qisenum.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/corelib/global/qisenum.h b/src/corelib/global/qisenum.h index c9b6ec6695..ef1ccc81a8 100644 --- a/src/corelib/global/qisenum.h +++ b/src/corelib/global/qisenum.h @@ -52,12 +52,18 @@ QT_BEGIN_NAMESPACE # define Q_IS_ENUM(x) __is_enum(x) # elif defined(Q_CC_MSVC) && defined(_MSC_FULL_VER) && (_MSC_FULL_VER >=140050215) # define Q_IS_ENUM(x) __is_enum(x) -# else -# include -# define Q_IS_ENUM(x) QtPrivate::is_enum::value +# elif defined(Q_CC_CLANG) +# if __has_extension(is_enum) +# define Q_IS_ENUM(x) __is_enum(x) +# endif # endif #endif +#ifndef Q_IS_ENUM +# include +# define Q_IS_ENUM(x) QtPrivate::is_enum::value +#endif + QT_END_HEADER QT_END_NAMESPACE -- cgit v1.2.3