diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2012-01-24 18:51:51 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-26 07:05:52 +0100 |
commit | 0bca94cf380a4fc55cf3a46de979d0618f3fa455 (patch) | |
tree | 174805df934ed12e7161604704c64d7eab36a67d | |
parent | 8eb2546bf23419e20064f4cf5c308e77831b3ee5 (diff) |
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 <bradley.hughes@nokia.com>
-rw-r--r-- | src/corelib/global/qglobal.h | 17 |
1 files 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 |