mirror of
https://github.com/reactos/reactos.git
synced 2025-06-03 08:20:27 +00:00
Always use the PSEH names for NLG to avoid conflicts when _SEH_NO_NATIVE_NLG is defined but <setjmp.h> is included nevertheless. This fixes the use of PSEH in win32k. Also declared the _SEHCompilerSpecificHandler as __inline so that GCC will ignore it when it's unused. This fixes the inclusion of <pseh.h> in a PCH
Patch by KJK svn path=/trunk/; revision=11892
This commit is contained in:
parent
572a3a13c5
commit
18ef45edfe
1 changed files with 17 additions and 7 deletions
|
@ -37,29 +37,39 @@
|
|||
*/
|
||||
#ifdef _SEH_NO_NATIVE_NLG
|
||||
# include <pseh/setjmp.h>
|
||||
# define longjmp _SEHLongJmp
|
||||
# define setjmp _SEHSetJmp
|
||||
# define jmp_buf _SEHJmpBuf_t
|
||||
#else
|
||||
# include <setjmp.h>
|
||||
# define _SEHLongJmp longjmp
|
||||
# define _SEHSetJmp setjmp
|
||||
# define _SEHJmpBuf_t jmp_buf
|
||||
#endif
|
||||
|
||||
typedef struct __SEHFrame
|
||||
{
|
||||
_SEHPortableFrame_t SEH_Header;
|
||||
jmp_buf SEH_JmpBuf;
|
||||
_SEHJmpBuf_t SEH_JmpBuf;
|
||||
void * SEH_Locals;
|
||||
}
|
||||
_SEHFrame_t;
|
||||
|
||||
static __declspec(noreturn) void __stdcall _SEHCompilerSpecificHandler
|
||||
/*
|
||||
Note: just define __inline to an empty symbol if your C compiler doesn't
|
||||
support it
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
# ifndef __inline
|
||||
# define __inline inline
|
||||
# endif
|
||||
#endif
|
||||
|
||||
static __declspec(noreturn) __inline void __stdcall _SEHCompilerSpecificHandler
|
||||
(
|
||||
_SEHPortableFrame_t * frame
|
||||
)
|
||||
{
|
||||
_SEHFrame_t * myframe;
|
||||
myframe = (_SEHFrame_t *)(((char *)frame) - offsetof(_SEHFrame_t, SEH_Header));
|
||||
longjmp(myframe->SEH_JmpBuf, 1);
|
||||
_SEHLongJmp(myframe->SEH_JmpBuf, 1);
|
||||
}
|
||||
|
||||
#define _SEH_FILTER(NAME_) \
|
||||
|
@ -117,7 +127,7 @@ static __declspec(noreturn) void __stdcall _SEHCompilerSpecificHandler
|
|||
_SEHPortableFrame = &_SEHFrame->SEH_Header; \
|
||||
(void)_SEHPortableFrame; \
|
||||
\
|
||||
if(setjmp(_SEHFrame->SEH_JmpBuf) == 0) \
|
||||
if(_SEHSetJmp(_SEHFrame->SEH_JmpBuf) == 0) \
|
||||
{ \
|
||||
_SEHEnter(&_SEHFrame->SEH_Header); \
|
||||
\
|
||||
|
|
Loading…
Reference in a new issue