aboutsummaryrefslogtreecommitdiffstats
path: root/scmfig.h
diff options
context:
space:
mode:
Diffstat (limited to 'scmfig.h')
-rw-r--r--scmfig.h66
1 files changed, 63 insertions, 3 deletions
diff --git a/scmfig.h b/scmfig.h
index a87e928..3e4b531 100644
--- a/scmfig.h
+++ b/scmfig.h
@@ -52,6 +52,46 @@
# endif
#endif
+/* MS Windows signal handling hack added by Rainer Urian */
+/*
+ SCM crashes on WindowsNT after hitting control-c.
+
+ This is because signal handling in windows console applications is
+ rather different from unix apps. If control-c is hit on a console
+ application Windows creates a new thread which executes the
+ control-c signal handler. Now, if the SCM handler does the longjmp
+ back to the repl loop it does it via the stack of the signal
+ handler thread which results always ever is an access violation.
+
+ The solution to this problem is to let the signal handler thread
+ raise a software interrupt in the main thread.
+
+ This is done with the following steps:
+
+ 1. contol-c is hit
+
+ 2. Windows creates the signal handler thread which in turn executes
+ the routine win32_sigint as its signal handler.
+
+ 3. The handler suspends the main thread and gets the main threads
+ register context.
+
+ 4. The handler simulates an interrupt call on the main thread by
+ pointing Eip to the sigintstub stub function and also simulates a
+ pushad , pushf of the main threads registers
+
+ 5. The handler resumes the main thread which when scheduled will
+ execute sigintstub, which in turn calls the proper signal interupt
+ (scamble_signal)
+*/
+#ifdef _WIN32
+/* POCKETCONSOLE has the signal handler implemented in the runtime */
+# ifndef POCKETCONSOLE
+# define WINSIGNALS
+# endif
+#endif
+
+
#include "scmflags.h" /* user specified, system independent flags */
/* IMPLINIT is the full pathname (surrounded by double quotes) of
@@ -241,6 +281,10 @@ rgx.c init_rgx(); regcomp and regexec. */
#ifdef __alpha
# define SHORT_INT
#endif
+#ifdef __ia64
+# define SHORT_INT
+# define CDR_DOUBLES
+#endif
#ifdef MSDOS /* Microsoft C 5.10 and 6.00A */
# ifndef GO32
# define SHORT_INT
@@ -273,9 +317,16 @@ rgx.c init_rgx(); regcomp and regexec. */
#ifdef MSDOS
# define STDC_HEADERS
#endif
+
+#ifdef POCKETCONSOLE
+# define NOSETBUF
+# define LACK_FTIME
+#endif
+
#ifdef vms
# define STDC_HEADERS
#endif
+
#ifdef nosve
# define STDC_HEADERS
#endif
@@ -637,8 +688,12 @@ extern ints_infot *ints_info;
#endif
#ifndef macintosh
-# ifdef __WINDOWS__ /* there should be a better flag for this. */
-# define PROT386
+# ifndef _M_ARM
+# ifndef _M_ARMT
+# ifdef __WINDOWS__ /* there should be a better flag for this. */
+# define PROT386
+# endif
+# endif
# endif
#endif
@@ -721,7 +776,12 @@ typedef SCM *SCMPTR;
# define SCM_INTERRUPTED(errno) (0)
#endif
-#define SYSCALL(line) do{errno = 0;line}while(SCM_INTERRUPTED(errno))
+#ifdef _WIN32
+// Windows doesn't set errno = EINTR
+# define SYSCALL(line) do{ line; while(GetLastError() == ERROR_OPERATION_ABORTED){SetLastError(0);Sleep(10);line};}while(0)
+#else
+# define SYSCALL(line) do{errno = 0;line}while(SCM_INTERRUPTED(errno))
+#endif
#ifdef EMFILE
# ifdef ENFILE