diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-05-17 10:30:41 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-05-27 14:12:07 -0700 |
commit | 23184fb6cd01fe906e2578f233088fc8904ce9a6 (patch) | |
tree | 9a29929cbc16e783955f93cc489a62af481bc388 /src | |
parent | d02e1eaae04164a647f1db3b714b6c83e296f8ed (diff) |
qglobal.h: use the GCC attribute for nothrow in C mode
There's exactly one use in Qt: the qVersion() function.
Change-Id: Ieb9a2aa1ea914b1b956bfffd16eff4b3b9e2119a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qcompilerdetection.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index fb9e65b194..2cbe9ee559 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -911,10 +911,14 @@ #else # define Q_CONSTEXPR const # define Q_DECL_CONSTEXPR -# define Q_DECL_NOEXCEPT # define Q_DECL_RELAXED_CONSTEXPR # define Q_NULLPTR NULL # define Q_RELAXED_CONSTEXPR const +# ifdef Q_CC_GNU +# define Q_DECL_NOEXCEPT __attribute__((__nothrow__)) +# else +# define Q_DECL_NOEXCEPT +# endif #endif #if __has_cpp_attribute(nodiscard) && (!defined(Q_CC_CLANG) || __cplusplus > 201402L) // P0188R1 |