diff --git a/msvc/Makefile b/msvc/Makefile index 9b39cef61..f4cd79ffc 100755 --- a/msvc/Makefile +++ b/msvc/Makefile @@ -255,7 +255,8 @@ compile.lsp: bare.lsp $(srcdir)/compile.lsp.in Makefile < $(srcdir)\compile.lsp.in > compile.lsp bare.lsp: $(srcdir)/bare.lsp.in lsp/load.lsp clos/load.lsp cmp/load.lsp cmp/cmpdefs.lsp c\cut "@true_srcdir@" "$(srcdir:\=/)" \ - "@true_builddir@" "$(MAKEDIR:\=/)" < $(srcdir)\bare.lsp.in > bare.lsp + "@true_builddir@" "$(MAKEDIR:\=/)"\ + "@ECL_CMPDIR@" "cmp" < $(srcdir)\bare.lsp.in > bare.lsp lsp/load.lsp: $(srcdir)/lsp/load.lsp.in $(CP) $(srcdir)\lsp\load.lsp.in lsp\load.lsp clos/load.lsp: $(srcdir)/clos/load.lsp.in diff --git a/src/c/alloc_2.d b/src/c/alloc_2.d old mode 100644 new mode 100755 index 8d56bfb4e..12ab21cd2 --- a/src/c/alloc_2.d +++ b/src/c/alloc_2.d @@ -191,7 +191,7 @@ ecl_alloc_object(cl_type t) case t_lock: case t_condition_variable: #endif -#ifdef ECL_SEMAPHORES: +#ifdef ECL_SEMAPHORES case t_semaphores: #endif case t_foreign: @@ -489,6 +489,7 @@ standard_finalizer(cl_object o) #endif #ifdef ECL_SEMAPHORES case t_semaphore: { + const cl_env_ptr the_env = ecl_process_env(); ecl_disable_interrupts_env(the_env); mp_semaphore_close(o); ecl_enable_interrupts_env(the_env); @@ -498,6 +499,7 @@ standard_finalizer(cl_object o) #ifdef ECL_THREADS case t_symbol: { cl_object cons = ecl_list1(MAKE_FIXNUM(o->symbol.binding)); + const cl_env_ptr the_env = ecl_process_env(); ecl_disable_interrupts_env(the_env); THREAD_OP_LOCK(); ECL_CONS_CDR(cons) = cl_core.reused_indices; diff --git a/src/c/file.d b/src/c/file.d old mode 100644 new mode 100755 index 1ef993130..28557b2d7 --- a/src/c/file.d +++ b/src/c/file.d @@ -5021,13 +5021,13 @@ init_file(void) stderr, smm_output, 8, flags, external_format); #else standard_input = ecl_make_file_stream_from_fd(make_constant_base_string("stdin"), - STDIN_FILENO, smm_input, 8, flags, + STDIN_FILENO, smm_input_file, 8, flags, external_format); standard_output = ecl_make_file_stream_from_fd(make_constant_base_string("stdout"), - STDOUT_FILENO, smm_output, 8, flags, + STDOUT_FILENO, smm_output_file, 8, flags, external_format); error_output = ecl_make_file_stream_from_fd(make_constant_base_string("stderr"), - STDERR_FILENO, smm_output, 8, flags, + STDERR_FILENO, smm_output_file, 8, flags, external_format); #endif cl_core.standard_input = standard_input; diff --git a/src/c/symbols_list.h b/src/c/symbols_list.h old mode 100644 new mode 100755 index 3b79f88bc..e9dbf8bc0 --- a/src/c/symbols_list.h +++ b/src/c/symbols_list.h @@ -1861,7 +1861,7 @@ cl_symbols[] = { {EXT_ "EXTERNAL-PROCESS-WAIT", EXT_ORDINARY, si_external_process_wait, -1, OBJNULL}, #if defined(_MSC_VER) || defined(mingw32) -{SI_ "CLOSE-WINDOWS-HANDLE", SI_ORDINARY, si_close_windows_handle, 1, OBJNULL}, +{SYS_ "CLOSE-WINDOWS-HANDLE", SI_ORDINARY, si_close_windows_handle, 1, OBJNULL}, #endif /* Tag for end of list */ diff --git a/src/c/symbols_list2.h b/src/c/symbols_list2.h old mode 100644 new mode 100755 index 61cc34ab5..8f5687e16 --- a/src/c/symbols_list2.h +++ b/src/c/symbols_list2.h @@ -1861,7 +1861,7 @@ cl_symbols[] = { {EXT_ "EXTERNAL-PROCESS-WAIT","si_external_process_wait"}, #if defined(_MSC_VER) || defined(mingw32) -{SI_ "CLOSE-WINDOWS-HANDLE","si_close_windows_handle"}, +{SYS_ "CLOSE-WINDOWS-HANDLE","si_close_windows_handle"}, #endif /* Tag for end of list */ diff --git a/src/c/unixsys.d b/src/c/unixsys.d old mode 100644 new mode 100755 index b0c3e097f..6f08ac7ef --- a/src/c/unixsys.d +++ b/src/c/unixsys.d @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include #include @@ -139,11 +139,12 @@ si_close_windows_handle(cl_object h) static cl_object make_windows_handle(HANDLE h) { - cl_object h = ecl_allocate_foreign_data(@':pointer', sizeof(HANDLE*)); - HANDLE *ph = (HANDLE*)h->foreign.data; + cl_object foreign = ecl_allocate_foreign_data(@':pointer-void', + sizeof(HANDLE*)); + HANDLE *ph = (HANDLE*)foreign->foreign.data; *ph = h; - si_set_finalizer(h, @'si::close-windows-handle'); - return h; + si_set_finalizer(foreign, @'si::close-windows-handle'); + return foreign; } #endif @@ -151,7 +152,7 @@ make_windows_handle(HANDLE h) cl_object status, code; @ { - if (!FIXNUMP(process_or_pid)) { + if (type_of(process_or_pid) == T_STRUCTURE) { cl_object pid = cl_funcall(2, @'ext::external-process-pid', process_or_pid); if (Null(pid)) { @@ -180,7 +181,7 @@ make_windows_handle(HANDLE h) status = @':error'; code = Cnil; } else if (exitcode == STILL_ACTIVE) { - status = @':runnning'; + status = @':running'; code = Cnil; } else { status = @':exited'; @@ -188,9 +189,9 @@ make_windows_handle(HANDLE h) process_or_pid->foreign.data = NULL; CloseHandle(*hProcess); } - ecl_enable_interrupts(the_env); + ecl_enable_interrupts_env(the_env); #else - cl_index pid = fix(process_or_pid); + cl_index pid = fixint(process_or_pid); int code_int; int error = waitpid(pid, &code_int, Null(wait)? WNOHANG : 0); if (error < 0) { @@ -250,7 +251,7 @@ make_windows_handle(HANDLE h) command = ecl_null_terminated_base_string(command); if (!Null(environ)) { - env_buffer = from_list_to_execve_arguments(environ, NULL); + env_buffer = from_list_to_execve_argument(environ, NULL); env = env_buffer->base_string.self; } @@ -396,7 +397,7 @@ make_windows_handle(HANDLE h) CloseHandle(pr_info.hThread); pid = make_windows_handle(pr_info.hProcess); } else { - const char *message; + char *message; FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, 0, GetLastError(), 0, (void*)&message, 0, NULL); diff --git a/src/h/external.h b/src/h/external.h old mode 100644 new mode 100755 index 137f54d74..485f7ac99 --- a/src/h/external.h +++ b/src/h/external.h @@ -1749,7 +1749,7 @@ extern ECL_API cl_object si_disable_interrupts(void); extern ECL_API cl_object si_enable_interrupts(void); extern ECL_API cl_object si_trap_fpe(cl_object condition, cl_object flag); #if defined(_MSC_VER) || defined(mingw32) -extern LONG WINAPI _ecl_w32_exception_filter(struct _EXCEPTION_POINTERS*); +extern ECL_API LONG WINAPI _ecl_w32_exception_filter(struct _EXCEPTION_POINTERS*); #endif extern ECL_API void ecl_check_pending_interrupts(void); diff --git a/src/h/stacks.h b/src/h/stacks.h old mode 100644 new mode 100755 index 126d099a2..32e5f4e91 --- a/src/h/stacks.h +++ b/src/h/stacks.h @@ -408,7 +408,6 @@ extern ECL_API ecl_frame_ptr _ecl_frs_push(register cl_env_ptr, register cl_obje ecl_frs_pop(__the_env); } while (0) #if defined(_MSC_VER) -extern ECL_API LONG WINAPI _ecl_w32_exception_filter(struct _EXCEPTION_POINTERS *); # define CL_CATCH_ALL_BEGIN(the_env) do { \ const cl_env_ptr __the_env = (the_env); \ _try { \