From 7d228473719e51995d3ebb497c53c93959e8b58b Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Tue, 16 Aug 2022 16:11:20 +0200 Subject: [PATCH] Move QT_NO_EXCEPTIONS define to qcompilerdetection.h Task-number: QTBUG-99313 Change-Id: I952267f18fd7ed001162aba7589c0040dbb9560e Reviewed-by: Thiago Macieira Reviewed-by: Edward Welbourne --- src/corelib/global/qcompilerdetection.h | 11 +++++++++++ src/corelib/global/qglobal.h | 12 ------------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index cab2b01a76c..322f2f4ae28 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -1313,6 +1313,17 @@ QT_WARNING_DISABLE_MSVC(4530) /* C++ exception handler used, but unwind semantic # endif #endif +#if !defined(QT_NO_EXCEPTIONS) +# if !defined(Q_MOC_RUN) +# if (defined(Q_CC_CLANG) && !__has_feature(cxx_exceptions)) || \ + (defined(Q_CC_GNU) && !defined(__EXCEPTIONS)) +# define QT_NO_EXCEPTIONS +# endif +# elif defined(QT_BOOTSTRAPPED) +# define QT_NO_EXCEPTIONS +# endif +#endif + #endif // __cplusplus #endif // QCOMPILERDETECTION_H diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 7ef6805ed4d..f0295b70f55 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -232,18 +232,6 @@ private: If you can't live with those constraints, don't use these macros. Use the QT_NO_EXCEPTIONS macro to protect your code instead. */ - -#if !defined(QT_NO_EXCEPTIONS) -# if !defined(Q_MOC_RUN) -# if (defined(Q_CC_CLANG) && !__has_feature(cxx_exceptions)) || \ - (defined(Q_CC_GNU) && !defined(__EXCEPTIONS)) -# define QT_NO_EXCEPTIONS -# endif -# elif defined(QT_BOOTSTRAPPED) -# define QT_NO_EXCEPTIONS -# endif -#endif - Q_NORETURN Q_DECL_COLD_FUNCTION Q_CORE_EXPORT void qTerminate() noexcept; #ifdef QT_NO_EXCEPTIONS # define QT_TRY if (true)