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)