--- a/chicken.h +++ b/chicken.h @@ -980,7 +980,15 @@ # ifdef HAVE_SIGPROCMASK # define C_sigprocmask sigprocmask # endif -# define C_setjmp setjmp -# define C_longjmp longjmp +/* MinGW's setjmp longjmps through SEH and crashes in RtlVirtualUnwind + on the alloca frames the compiler emits. CHICKEN uses longjmp only to + drop back to the trampoline, so the builtin jump is the right tool. */ +# if defined(__MINGW32__) && defined(__GNUC__) +# define C_setjmp __builtin_setjmp +# define C_longjmp __builtin_longjmp +# else +# define C_setjmp setjmp +# define C_longjmp longjmp +# endif # define C_alloca alloca # define C_strerror strerror