summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobal.h
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2022-08-16 17:18:13 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2022-08-19 09:15:39 +0200
commit0329792602310577fa66c6991b891140b6edd210 (patch)
treeef71e52870bc650cff4957057f455635e3c121df /src/corelib/global/qglobal.h
parent7d228473719e51995d3ebb497c53c93959e8b58b (diff)
Extract header qexceptionhandling.h from qglobal.h
As a drive-by, remove the unused include for std::bad_alloc from qglobal.cpp. Task-number: QTBUG-99313 Change-Id: I4b26b4413e6fe7ac3b1e285d0db5b81b429a4713 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/corelib/global/qglobal.h')
-rw-r--r--src/corelib/global/qglobal.h27
1 files changed, 1 insertions, 26 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index f0295b70f5..13452bf22a 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -225,32 +225,6 @@ private:
#endif // Q_OS_DARWIN
-/* These wrap try/catch so we can switch off exceptions later.
-
- Beware - do not use more than one QT_CATCH per QT_TRY, and do not use
- the exception instance in the catch block.
- If you can't live with those constraints, don't use these macros.
- Use the QT_NO_EXCEPTIONS macro to protect your code instead.
-*/
-Q_NORETURN Q_DECL_COLD_FUNCTION Q_CORE_EXPORT void qTerminate() noexcept;
-#ifdef QT_NO_EXCEPTIONS
-# define QT_TRY if (true)
-# define QT_CATCH(A) else
-# define QT_THROW(A) qt_noop()
-# define QT_RETHROW qt_noop()
-# define QT_TERMINATE_ON_EXCEPTION(expr) do { expr; } while (false)
-#else
-# define QT_TRY try
-# define QT_CATCH(A) catch (A)
-# define QT_THROW(A) throw A
-# define QT_RETHROW throw
-# ifdef Q_COMPILER_NOEXCEPT
-# define QT_TERMINATE_ON_EXCEPTION(expr) do { expr; } while (false)
-# else
-# define QT_TERMINATE_ON_EXCEPTION(expr) do { try { expr; } catch (...) { qTerminate(); } } while (false)
-# endif
-#endif
-
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool qSharedBuild() noexcept;
/*
@@ -407,6 +381,7 @@ QT_END_NAMESPACE
#include <QtCore/qatomic.h>
#include <QtCore/qenvironmentvariables.h>
+#include <QtCore/qexceptionhandling.h>
#include <QtCore/qforeach.h>
#include <QtCore/qglobalstatic.h>
#include <QtCore/qminmax.h>