diff --git a/win32/include/_mingw.h b/win32/include/_mingw.h index 295b689f..bbac35e2 100644 --- a/win32/include/_mingw.h +++ b/win32/include/_mingw.h @@ -57,6 +57,8 @@ typedef unsigned __int64 uintptr_t; #define __stdcall #define _AMD64_ 1 #define __x86_64 1 +#define USE_MINGW_SETJMP_TWO_ARGS +#define mingw_getsp tinyc_getsp #else typedef __int32 intptr_t; typedef unsigned __int32 uintptr_t; diff --git a/win32/lib/chkstk.S b/win32/lib/chkstk.S index 9be95978..90a6f0dc 100644 --- a/win32/lib/chkstk.S +++ b/win32/lib/chkstk.S @@ -56,6 +56,14 @@ P0: mov (%rax),%rcx /* restore ecx */ jmp *8(%rax) +/* ---------------------------------------------- */ +/* avoid msvcrt unwind stuff for setjmp/longjmp */ + +.globl tinyc_getsp +tinyc_getsp: + xor %rax,%rax + ret + /* ---------------------------------------------- */ #endif /* ---------------------------------------------- */