From cd2e04bb22b1a3f40fa5ae0885de7fbda197daed Mon Sep 17 00:00:00 2001 From: Daniel Kochmanski Date: Wed, 3 Feb 2016 15:13:39 +0100 Subject: [PATCH] windows: some love for this poor system --- msvc/Makefile | 1 + src/c/unixint.d | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/msvc/Makefile b/msvc/Makefile index 4ad0a8fc3..ed2c70e8c 100755 --- a/msvc/Makefile +++ b/msvc/Makefile @@ -297,6 +297,7 @@ cmp/load.lsp: $(srcdir)/cmp/load.lsp.in $(CP) $(srcdir)\cmp\load.lsp.in cmp\load.lsp cmp/cmpdefs.lsp: $(srcdir)/cmp/cmpdefs.lsp Makefile c\cut "@ECL_CC@" "$(CC)" \ + "@CC_IS_CXX@" "nil" \ "@CFLAGS@" "$(CFLAGS)" \ "@CFLAGS_OPTIMIZE@" "$(CFLAGS_OPTIMIZE)" \ "@ECL_CFLAGS@" "" \ diff --git a/src/c/unixint.d b/src/c/unixint.d index a0d0d95ee..087b87c5c 100644 --- a/src/c/unixint.d +++ b/src/c/unixint.d @@ -1122,11 +1122,16 @@ _ecl_w32_exception_filter(struct _EXCEPTION_POINTERS* ep) static cl_object W32_handle_in_new_thread(cl_object signal_code) { + /* XXX: there is some bug present only on windows platform + with importing the current thread. Don't know how to track + it though. */ +#if 0 int outside_ecl = ecl_import_current_thread(@'si::handle-signal', ECL_NIL); mp_process_run_function(4, @'si::handle-signal', @'si::handle-signal', signal_code, ECL_NIL); if (outside_ecl) ecl_release_current_thread(); +#endif /* 0 */ } BOOL WINAPI W32_console_ctrl_handler(DWORD type) @@ -1134,17 +1139,19 @@ BOOL WINAPI W32_console_ctrl_handler(DWORD type) switch (type) { case CTRL_C_EVENT: case CTRL_BREAK_EVENT: { - cl_object function = ECL_SYM_FUN(@'si::terminal-interrupt'); - if (function) - W32_handle_in_new_thread(function); + /* cl_object function = */ + /* ECL_SYM_FUN(@'si::terminal-interrupt'); */ + /* if (function) */ + /* W32_handle_in_new_thread(function); */ return TRUE; } case CTRL_CLOSE_EVENT: case CTRL_LOGOFF_EVENT: case CTRL_SHUTDOWN_EVENT: - cl_object function = ECL_SYM_FUN(@'si::quit'); - if (function) - W32_handle_in_new_thread(function); + /* Doing nothing is arguably the most + reasonable. Calling (quit) causes process to exit + and Windows has problems, because "process has + unexpectably died.*/ return TRUE; default: return FALSE;