File indexing completed on 2025-01-18 10:07:23
0001
0002
0003
0004 #ifndef QEXCEPTIONHANDLING_H
0005 #define QEXCEPTIONHANDLING_H
0006
0007 #include <QtCore/qtconfigmacros.h>
0008 #include <QtCore/qcompilerdetection.h>
0009 #include <QtCore/qtcoreexports.h>
0010
0011 #if 0
0012 #pragma qt_class(QtExceptionHandling)
0013 #pragma qt_sync_stop_processing
0014 #endif
0015
0016 QT_BEGIN_NAMESPACE
0017
0018
0019
0020
0021
0022
0023
0024
0025 Q_NORETURN Q_DECL_COLD_FUNCTION Q_CORE_EXPORT void qTerminate() noexcept;
0026 #ifdef QT_NO_EXCEPTIONS
0027 # define QT_TRY if (true)
0028 # define QT_CATCH(A) else
0029 # define QT_THROW(A) qt_noop()
0030 # define QT_RETHROW qt_noop()
0031 # define QT_TERMINATE_ON_EXCEPTION(expr) do { expr; } while (false)
0032 #else
0033 # define QT_TRY try
0034 # define QT_CATCH(A) catch (A)
0035 # define QT_THROW(A) throw A
0036 # define QT_RETHROW throw
0037 # ifdef Q_COMPILER_NOEXCEPT
0038 # define QT_TERMINATE_ON_EXCEPTION(expr) do { expr; } while (false)
0039 # else
0040 # define QT_TERMINATE_ON_EXCEPTION(expr) do { try { expr; } catch (...) { qTerminate(); } } while (false)
0041 # endif
0042 #endif
0043
0044 QT_END_NAMESPACE
0045
0046 #endif