[PSEH] Make the dummy PSEH at least usable.

Not screwing the code flow when no exception happens would be the least
This commit is contained in:
Jérôme Gardou 2021-04-21 19:50:31 +02:00 committed by Jérôme Gardou
parent 617c7cc377
commit 96a2b18903

View file

@ -42,15 +42,36 @@
extern int _SEH2_Volatile0;
extern int _SEH2_VolatileExceptionCode;
#define _SEH2_TRY {
#define _SEH2_FINALLY } {
#define _SEH2_EXCEPT(...) } if (_SEH2_Volatile0 || (0 && (__VA_ARGS__))) {
#define _SEH2_END }
#define _SEH2_TRY \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wunused-label\"")\
{ \
__label__ __seh2_scope_end__;
#define _SEH2_FINALLY \
__seh2_scope_end__:; \
} \
if (1) \
{ \
__label__ __seh2_scope_end__;
#define _SEH2_EXCEPT(...) \
__seh2_scope_end__:; \
} \
if (_SEH2_Volatile0 || (0 && (__VA_ARGS__))) \
{ \
__label__ __seh2_scope_end__;
#define _SEH2_END \
__seh2_scope_end__:; \
} \
_Pragma("GCC diagnostic pop")
#define _SEH2_GetExceptionInformation() ((struct _EXCEPTION_POINTERS*)0)
#define _SEH2_GetExceptionCode() _SEH2_VolatileExceptionCode
#define _SEH2_AbnormalTermination() (0)
#define _SEH2_YIELD(STMT_) STMT_
#define _SEH2_LEAVE
#define _SEH2_LEAVE goto __seh2_scope_end__;
#define _SEH2_VOLATILE volatile
#elif defined(_USE_PSEH3)