Ticket #1453: patch.txt

File patch.txt, 1.5 KB (added by jrobbins, 6 years ago)
Line 
1Index: third-party/chicken/runtime.c
2===================================================================
3--- third-party/chicken/runtime.c       (revision 145132)
4+++ third-party/chicken/runtime.c       (revision 145133)
5@@ -1488,6 +1488,10 @@
6 
7 #if C_STACK_GROWS_DOWNWARD
8   C_stack_hard_limit = (C_word *)((C_byte *)C_stack_pointer - stack_size);
9+# ifdef __MINGW64__
10+    /* For some reason, on MinGW64, the stack is about 4 to 5 KB smaller than it should be. */
11+    C_stack_hard_limit += 8192;
12+# endif
13 #else
14   C_stack_hard_limit = (C_word *)((C_byte *)C_stack_pointer + stack_size);
15 #endif
16Index: third-party/chicken/chicken.h
17===================================================================
18--- third-party/chicken/chicken.h       (revision 145132)
19+++ third-party/chicken/chicken.h       (revision 145133)
20@@ -964,8 +964,16 @@
21 # ifdef HAVE_SIGPROCMASK
22 #  define C_sigprocmask             sigprocmask
23 # endif
24-# define C_setjmp                   setjmp
25-# define C_longjmp                  longjmp
26+
27+# if defined(__MINGW64__) && defined(__GNUC__)
28+/* on 64-bit MinGW, setjmp and longjmp are known to be buggy; use GCC's builtin ones instead. */
29+#  define C_setjmp                   __builtin_setjmp
30+#  define C_longjmp                  __builtin_longjmp
31+# else
32+#  define C_setjmp                   setjmp
33+#  define C_longjmp                  longjmp
34+# endif
35+
36 # define C_alloca                   alloca
37 # define C_strerror                 strerror
38 # define C_isalpha                  isalpha