[PSEH2_TEST] Fix compilation with MSVC

This commit is contained in:
Timo Kreuzer 2020-03-09 22:17:22 +01:00
parent 16d8190f51
commit 1fa9fdb625
2 changed files with 14 additions and 16 deletions

View file

@ -1,6 +1,4 @@
add_subdirectory(mmixer_test)
if(NOT MSVC)
add_subdirectory(pseh2)
endif()
add_subdirectory(pseh2)
add_subdirectory(dllexport)
add_subdirectory(spec2def)

View file

@ -2417,7 +2417,7 @@ DEFINE_TEST(test_unvolatile)
_SEH2_TRY
{
val = return_one();
*((char*)0xc0000000) = 0;
*((char*)(intptr_t)0xc0000000) = 0;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
@ -2435,7 +2435,7 @@ DEFINE_TEST(test_unvolatile_2)
_SEH2_TRY
{
val = 1;
*((char*)0xc0000000) = 0;
*((char*)(intptr_t)0xc0000000) = 0;
val = 2;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
@ -2467,7 +2467,7 @@ DEFINE_TEST(test_unvolatile_3)
_SEH2_TRY
{
val2 = 1;
*((char*)0xc0000000) = 0;
*((char*)(intptr_t)0xc0000000) = 0;
val2 = 2;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
@ -2477,7 +2477,7 @@ DEFINE_TEST(test_unvolatile_3)
_SEH2_END;
val1 = 2;
*((int*)0xc0000000) = 1;
*((int*)(intptr_t)0xc0000000) = 1;
val1 = 3;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
@ -2511,7 +2511,7 @@ DEFINE_TEST(test_unvolatile_4)
_SEH2_TRY
{
*(char*)0x80000000 = 1;
*(char*)(intptr_t)0x80000000 = 1;
}
_SEH2_EXCEPT(result == 0xdeadbeef)
{
@ -2539,7 +2539,7 @@ DEFINE_TEST(test_finally_goto)
_SEH2_FINALLY
{
val |= 4;
*((char*)0xdeadc0de) = 0;
*((char*)(intptr_t)0xdeadc0de) = 0;
val |= 8;
}
_SEH2_END;
@ -2547,7 +2547,7 @@ DEFINE_TEST(test_finally_goto)
val |= 16;
next:
val |= 32;
*((char*)0xdeadc0de) = 0;
*((char*)(intptr_t)0xdeadc0de) = 0;
val |= 64;
}
_SEH2_EXCEPT(1)
@ -2569,19 +2569,19 @@ DEFINE_TEST(test_nested_exception)
_SEH2_TRY
{
val |= 2;
*((char*)0xdeadc0de) = 0;
*((char*)(intptr_t)0xdeadc0de) = 0;
val |= 4;
}
_SEH2_EXCEPT(1)
{
val |= 8;
*((char*)0xdeadc0de) = 0;
*((char*)(intptr_t)0xdeadc0de) = 0;
val |= 16;
}
_SEH2_END;
val |= 32;
*((char*)0xdeadc0de) = 0;
*((char*)(intptr_t)0xdeadc0de) = 0;
val |= 64;
}
_SEH2_EXCEPT(1)
@ -2644,14 +2644,14 @@ int call_test(int (* func)(void))
static int ret;
static struct volatile_context before, after;
static LPTOP_LEVEL_EXCEPTION_FILTER prev_unhandled_exception;
#ifndef _PSEH3_H_
#if !defined(_PSEH3_H_) && !defined(_MSC_VER)
static _SEH2Registration_t * prev_frame;
_SEH2Registration_t passthrough_frame;
#endif
prev_unhandled_exception = SetUnhandledExceptionFilter(&unhandled_exception);
#if defined(_X86_) && !defined(_PSEH3_H_)
#if defined(_X86_) && !defined(_PSEH3_H_) && !defined(_MSC_VER)
prev_frame = (_SEH2Registration_t *)__readfsdword(0);
passthrough_frame.SER_Prev = prev_frame;
passthrough_frame.SER_Handler = passthrough_handler;
@ -2687,7 +2687,7 @@ int call_test(int (* func)(void))
ret = func();
#endif
#if defined(_X86_) && !defined(_PSEH3_H_)
#if defined(_X86_) && !defined(_PSEH3_H_) && !defined(_MSC_VER)
if((_SEH2Registration_t *)__readfsdword(0) != &passthrough_frame || passthrough_frame.SER_Prev != prev_frame)
{
trace("exception registration list corrupted\n");