Author: hyperion Date: Sun Nov 23 21:00:50 2008 New Revision: 37606
URL: http://svn.reactos.org/svn/reactos?rev=37606&view=rev Log: Fixed _SEH2_EXCEPT
Modified: trunk/reactos/include/reactos/libs/pseh/pseh2.h
Modified: trunk/reactos/include/reactos/libs/pseh/pseh2.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/libs/pseh/p... ============================================================================== --- trunk/reactos/include/reactos/libs/pseh/pseh2.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/libs/pseh/pseh2.h [iso-8859-1] Sun Nov 23 21:00:50 2008 @@ -94,6 +94,12 @@ /* Soft memory barrier */ #define __SEH_BARRIER __asm__ __volatile__("#":::"memory")
+/* GCC doesn't know that this equals zero */ +#define __SEH_ZERO ({ int zero = 0; __asm__ __volatile__("#" : "+g" (zero)); zero; }) + +#define __SEH_FALSE __builtin_expect(__SEH_ZERO, 0) +#define __SEH_TRUE __builtin_expect(!__SEH_ZERO, 1) + typedef struct __SEH2Registration { struct __SEH2Registration * SER_Prev; @@ -251,7 +257,7 @@ __SEH_USE_NESTED_FUNCTION(_SEHFinally); \ \ _SEHTryLevel.ST_FramePointer = _SEHClosureFromTrampoline((_SEHTrampoline_t *)&_SEHFinally); \ - _SEHTryLevel.ST_Filter = NULL; \ + _SEHTryLevel.ST_Filter = 0; \ _SEHTryLevel.ST_Body = _SEHFunctionFromTrampoline((_SEHTrampoline_t *)&_SEHFinally); \ \ goto _SEHDoTry; \ @@ -318,8 +324,11 @@ { \ __SEH_LEAVE_TRYLEVEL(); \ } \ -\ - goto _SEHEndExcept; \ + \ + if(__SEH_FALSE) \ + goto _SEHBeginExcept; \ + else \ + goto _SEHEndExcept; \ \ _SEHBeginExcept: __SEH_SIDE_EFFECT; \ { \