diff --git a/tccrun.c b/tccrun.c index 1b19dd78..2924322a 100644 --- a/tccrun.c +++ b/tccrun.c @@ -1533,6 +1533,9 @@ static long __stdcall cpu_exception_handler(EXCEPTION_POINTERS *ex_info) { rt_frame f; unsigned code; +#if defined(_WIN64) && defined(__aarch64__) && !defined(CONFIG_TCC_BACKTRACE_ONLY) + TCCState *s; +#endif rt_getcontext(ex_info->ContextRecord, &f); switch (code = ex_info->ExceptionRecord->ExceptionCode) { @@ -1555,7 +1558,6 @@ static long __stdcall cpu_exception_handler(EXCEPTION_POINTERS *ex_info) break; } #if defined(_WIN64) && defined(__aarch64__) && !defined(CONFIG_TCC_BACKTRACE_ONLY) - TCCState *s; rt_wait_sem(); s = rt_find_state(&f); rt_post_sem(); diff --git a/tests/libtcc_test_mt.c b/tests/libtcc_test_mt.c index 4db027f7..23764637 100644 --- a/tests/libtcc_test_mt.c +++ b/tests/libtcc_test_mt.c @@ -339,7 +339,12 @@ int main(int argc, char **argv) #include #ifdef _WIN32 -void __stdcall Sleep(unsigned int milliseconds); +# ifdef __i386__ +# define LIBTCC_TEST_WINAPI __attribute__((__stdcall__)) +# else +# define LIBTCC_TEST_WINAPI +# endif +void LIBTCC_TEST_WINAPI Sleep(unsigned int milliseconds); #else unsigned int sleep(unsigned int seconds); #endif