diff --git a/sdk/include/reactos/libs/pseh/pseh2.h b/sdk/include/reactos/libs/pseh/pseh2.h index 8437bbe2f7a..45f872e7757 100644 --- a/sdk/include/reactos/libs/pseh/pseh2.h +++ b/sdk/include/reactos/libs/pseh/pseh2.h @@ -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)