mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
[lua] compilation fix for Windows
There is no sigsetjmp function on mingw64.
This commit is contained in:
parent
5c31030221
commit
3aed9a8fda
@ -79,7 +79,11 @@ lua_State *lua_state;
|
|||||||
|
|
||||||
static struct session *lua_ses;
|
static struct session *lua_ses;
|
||||||
static struct terminal *errterm;
|
static struct terminal *errterm;
|
||||||
|
#ifdef CONFIG_OS_WIN32
|
||||||
|
static jmp_buf errjmp;
|
||||||
|
#else
|
||||||
static sigjmp_buf errjmp;
|
static sigjmp_buf errjmp;
|
||||||
|
#endif
|
||||||
|
|
||||||
#define L lua_state
|
#define L lua_state
|
||||||
#define LS lua_State *S
|
#define LS lua_State *S
|
||||||
@ -771,7 +775,11 @@ static void
|
|||||||
handle_sigint(void *data)
|
handle_sigint(void *data)
|
||||||
{
|
{
|
||||||
finish_lua();
|
finish_lua();
|
||||||
|
#ifdef CONFIG_OS_WIN32
|
||||||
|
longjmp(errjmp, -1);
|
||||||
|
#else
|
||||||
siglongjmp(errjmp, -1);
|
siglongjmp(errjmp, -1);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -781,8 +789,11 @@ prepare_lua(struct session *ses)
|
|||||||
errterm = lua_ses ? lua_ses->tab->term : NULL;
|
errterm = lua_ses ? lua_ses->tab->term : NULL;
|
||||||
/* XXX this uses the wrong term, I think */
|
/* XXX this uses the wrong term, I think */
|
||||||
install_signal_handler(SIGINT, (void (*)(void *)) handle_sigint, NULL, 1);
|
install_signal_handler(SIGINT, (void (*)(void *)) handle_sigint, NULL, 1);
|
||||||
|
#ifdef CONFIG_OS_WIN32
|
||||||
|
return setjmp(errjmp);
|
||||||
|
#else
|
||||||
return sigsetjmp(errjmp, 1);
|
return sigsetjmp(errjmp, 1);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user