fix one of the limitations of QT_TRY/QT_CATCH macros

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2019-08-01 19:28:45 +00:00
parent b221d460cb
commit 890cf73ff9

View file

@ -653,9 +653,8 @@ inline void qt_noop(void) {}
/* These wrap try/catch so we can switch off exceptions later. /* 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 Beware - do not use the exception instance in the catch block.
the exception instance in the catch block. If you can't live with that constraint, don't use these macros.
If you can't live with those constraints, don't use these macros.
Use the QT_NO_EXCEPTIONS macro to protect your code instead. Use the QT_NO_EXCEPTIONS macro to protect your code instead.
*/ */
@ -665,7 +664,7 @@ inline void qt_noop(void) {}
#ifdef QT_NO_EXCEPTIONS #ifdef QT_NO_EXCEPTIONS
# define QT_TRY if (true) # define QT_TRY if (true)
# define QT_CATCH(A) else # define QT_CATCH(A) else if (false)
# define QT_THROW(A) qt_noop() # define QT_THROW(A) qt_noop()
# define QT_RETHROW qt_noop() # define QT_RETHROW qt_noop()
#else #else