diff options
author | R.J.V. Bertin <rjvbertin@gmail.com> | 2017-05-31 12:04:18 +0200 |
---|---|---|
committer | René J.V. Bertin <rjvbertin@gmail.com> | 2017-06-05 07:20:55 +0000 |
commit | e8d391f1f409b1fe87cf117e16f3d3cc65ef3305 (patch) | |
tree | bb0061a810b83c1c518d82a0bcb8b7ebc5a93974 /src/corelib/global/qcompilerdetection.h | |
parent | 1131db8b4708dfa222b50fb4981a7becaf5ae4a3 (diff) |
define QT_NO_EXCEPTIONS reliably when using Clang
Clang's definition of the __EXCEPTIONS macro is inconsistent across
platforms. When compiling for Darwin, Clang 3.6 and newer will set the
token when exceptions are enabled in either C++ or ObjC. This change
adds the reliable check described in the Clang 3.6 release notes to
ensure that QT_NO_EXCEPTIONS is defined when required.
Task-number: QTBUG-61034
Change-Id: I8205793c1501a4243b14d8642fe1f16d2df69be4
(cherry picked from commit 6e97d091e4d30566c14cf726f44d9e17f819c2c2)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qcompilerdetection.h')
-rw-r--r-- | src/corelib/global/qcompilerdetection.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index c8f1280e21..038ad03cb0 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -1155,6 +1155,16 @@ #endif /* + * a useful extension from Clang + * http://clang.llvm.org/docs/LanguageExtensions.html#feature-checking-macros + */ +#ifdef __has_feature +# define QT_HAS_FEATURE(x) __has_feature(x) +#else +# define QT_HAS_FEATURE(x) 0 +#endif + +/* * Warning/diagnostic handling */ |