From 0bca94cf380a4fc55cf3a46de979d0618f3fa455 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 24 Jan 2012 18:51:51 +0100 Subject: Wrap unimplemented clang feature in __has_feature So that when they are actually implemented in future version, the proper defines get defined. Change-Id: I5cc3e3ef64b06facc27e6d697700dcb7a96300d5 Reviewed-by: Bradley T. Hughes --- src/corelib/global/qglobal.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index a65e6747ed..72d384e464 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -797,15 +797,24 @@ namespace QT_NAMESPACE {} # define Q_COMPILER_RANGE_FOR # define Q_COMPILER_UNICODE_STRINGS # endif -# if 0 /*) not implemented in clang */ -# define Q_COMPILER_ATOMICS + /* not implemented in clang yet */ +# if __has_feature(cxx_constexpr) # define Q_COMPILER_CONSTEXPR -# define Q_COMPILER_INITIALIZER_LISTS +# endif +# if __has_feature(cxx_lambdas) # define Q_COMPILER_LAMBDA +# endif +# if __has_feature(cxx_generalized_initializers) +# define Q_COMPILER_INITIALIZER_LISTS +# endif +# if __has_feature(cxx_unrestricted_unions) # define Q_COMPILER_UNRESTRICTED_UNIONS # endif +# if 0 +# define Q_COMPILER_ATOMICS +# endif # endif -#endif +#endif // Q_CC_CLANG #ifndef Q_PACKED # define Q_PACKED -- cgit v1.2.3