1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-27 01:25:34 +00:00

[lua] compilation fix for Windows

There is no sigsetjmp function on mingw64.
This commit is contained in:
Witold Filipczyk 2023-11-08 09:08:54 +01:00
parent 5c31030221
commit 3aed9a8fda

View File

@ -79,7 +79,11 @@ lua_State *lua_state;
static struct session *lua_ses;
static struct terminal *errterm;
#ifdef CONFIG_OS_WIN32
static jmp_buf errjmp;
#else
static sigjmp_buf errjmp;
#endif
#define L lua_state
#define LS lua_State *S
@ -771,7 +775,11 @@ static void
handle_sigint(void *data)
{
finish_lua();
#ifdef CONFIG_OS_WIN32
longjmp(errjmp, -1);
#else
siglongjmp(errjmp, -1);
#endif
}
int
@ -781,8 +789,11 @@ prepare_lua(struct session *ses)
errterm = lua_ses ? lua_ses->tab->term : NULL;
/* XXX this uses the wrong term, I think */
install_signal_handler(SIGINT, (void (*)(void *)) handle_sigint, NULL, 1);
#ifdef CONFIG_OS_WIN32
return setjmp(errjmp);
#else
return sigsetjmp(errjmp, 1);
#endif
}
void