Attempt supporting setjmp on MSVC

This commit is contained in:
Christoffer Lerno
2022-12-07 21:20:30 +01:00
committed by Christoffer Lerno
parent eaaa5362a5
commit de4bfe470e
8 changed files with 28 additions and 2 deletions

View File

@@ -64,9 +64,14 @@ extern fn void srand(uint seed);
define JmpBuf = CInt[$$JMP_BUF_SIZE];
extern fn CInt setjmp(JmpBuf* buffer);
extern fn void longjmp(JmpBuf* buffer, CInt value);
$if (env::OS_TYPE == OsType.WIN32):
// TODO win32 aarch64
extern fn CInt _setjmp(void* frameptr, JmpBuf* buffer);
macro CInt setjmp(JmpBuf* buffer) = _setjmp($$frameaddress(), buffer);
$else:
extern fn CInt setjmp(JmpBuf* buffer);
$endif;
// MB functions omitted
// string