Windows Ctrl-C working.

This commit is contained in:
Brad Nelson
2023-01-14 17:38:58 -08:00
parent fc6c771d86
commit 3dcd421576
5 changed files with 59 additions and 17 deletions

View File

@ -25,15 +25,6 @@ enum {
#undef Z
};
static BOOL WINAPI forth_ctrl_handler(DWORD fdwCtrlType) {
if (fdwCtrlType == CTRL_C_EVENT ||
fdwCtrlType == CTRL_BREAK_EVENT) {
// RaiseException(EXCEPTION_BREAKPOINT, 0, 0, 0);
return TRUE;
}
return FALSE;
}
static cell_t *forth_run(cell_t *init_rp) {
static const BUILTIN_WORD builtins[] = {
#define Z(flags, name, op, code) \
@ -54,7 +45,6 @@ static cell_t *forth_run(cell_t *init_rp) {
}
register cell_t *ip, *rp, *sp, tos, w;
register float *fp, ft;
SetConsoleCtrlHandler(forth_ctrl_handler, TRUE);
rp = init_rp; UNPARK;
for (;;) {
__try {