User break (Ctrl+C) is now captured under windows

This commit is contained in:
jjgarcia 2005-01-11 14:40:37 +00:00
parent 7ef23a5341
commit 3daeb3ca60

View file

@ -170,6 +170,18 @@ LONG WINAPI W32_exception_filter(struct _EXCEPTION_POINTERS* ep)
return excpt_result;
}
BOOL WINAPI W32_console_ctrl_handler(DWORD type)
{
switch (type)
{
/* Catch CTRL-C */
case CTRL_C_EVENT:
handle_signal(SIGINT);
return TRUE;
}
return FALSE;
}
#endif
void
@ -182,6 +194,7 @@ init_unixint(void)
#endif
#ifdef _MSC_VER
SetUnhandledExceptionFilter(W32_exception_filter);
SetConsoleCtrlHandler(W32_console_ctrl_handler, TRUE);
#endif
ECL_SET(@'si::*interrupt-enable*', Ct);
ecl_interrupt_enable = 1;