--- gforth/engine/signals.c 2007/03/25 21:30:59 1.34 +++ gforth/engine/signals.c 2012/03/16 20:34:23 1.43 @@ -1,12 +1,12 @@ /* signal handling - Copyright (C) 1995,1996,1997,1998,2000,2003,2006 Free Software Foundation, Inc. + Copyright (C) 1995,1996,1997,1998,2000,2003,2006,2007,2011 Free Software Foundation, Inc. This file is part of Gforth. Gforth is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 + as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. + along with this program; if not, see http://www.gnu.org/licenses/. */ @@ -30,9 +29,9 @@ #if !defined(apollo) && !defined(MSDOS) #include #endif -/* #include */ #include #include +#include #include "io.h" #ifndef HAVE_STACK_T @@ -41,7 +40,7 @@ typedef struct sigaltstack stack_t; #endif #define DEFAULTCOLS 80 -#if defined(MSDOS) || defined (_WIN32) +#if defined(MSDOS) || defined (_WIN32) || defined (__CYGWIN__) #define DEFAULTROWS 25 #else #define DEFAULTROWS 24 @@ -93,7 +92,7 @@ graceful_exit (int sig) exit (0x80|sig); } -jmp_buf throw_jmp_buf; +__thread jmp_buf throw_jmp_buf; void throw(int code) { @@ -232,7 +231,7 @@ void get_winsize() #endif if (rows==0) rows=DEFAULTROWS; - if (rows==0) + if (cols==0) cols=DEFAULTCOLS; } @@ -415,7 +414,7 @@ void install_signal_handlers(void) sigstack.ss_flags=0; sas_retval=sigaltstack(&sigstack,(stack_t *)0); } -#ifdef HAS_FILE +#if defined(HAS_FILE) || !defined(STANDALONE) if (debug) fprintf(stderr,"sigaltstack: %s\n",strerror(sas_retval)); #endif