From df06dd542de6cc8c90d7a92f3596b3955a9efabf Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Tue, 14 Jul 2009 10:25:46 +0000 Subject: [PATCH] 2009-07-14 12:25 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rtl/gtcrs/gtcrs.c * harbour/source/rtl/gttrm/gttrm.c * updated to compile with DJGPP 2.03 --- harbour/ChangeLog | 5 +++++ harbour/source/rtl/gtcrs/gtcrs.c | 11 +++++++++-- harbour/source/rtl/gttrm/gttrm.c | 5 ++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d3f403b97c..cf5b2b3a8e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,11 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-07-14 12:25 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/rtl/gtcrs/gtcrs.c + * harbour/source/rtl/gttrm/gttrm.c + * updated to compile with DJGPP 2.03 + 2009-07-14 12:15 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * source/vm/extend.c ! Fixed hb_parvcx() to return "" instead of NULL when dealing diff --git a/harbour/source/rtl/gtcrs/gtcrs.c b/harbour/source/rtl/gtcrs/gtcrs.c index 1dd650e166..f132b480e8 100644 --- a/harbour/source/rtl/gtcrs/gtcrs.c +++ b/harbour/source/rtl/gtcrs/gtcrs.c @@ -60,13 +60,15 @@ static HB_GT_FUNCS SuperTable; #define HB_GTSUPER (&SuperTable) #define HB_GTID_PTR (&s_GtId) +static volatile BOOL s_SignalTable[MAX_SIGNO]; +#if defined( SA_NOCLDSTOP ) && defined( SA_RESTART ) && defined( SIGCHLD ) +static volatile BOOL s_SignalFlag = FALSE; /* this variable should be global and checked in main VM loop */ static volatile BOOL s_BreakFlag = FALSE; static volatile BOOL s_InetrruptFlag = FALSE; +#endif static volatile BOOL s_WinSizeChangeFlag = FALSE; -static volatile BOOL s_SignalFlag = FALSE; -static volatile BOOL s_SignalTable[MAX_SIGNO]; static int s_iStdIn, s_iStdOut, s_iStdErr; @@ -1738,6 +1740,7 @@ static int gt_getsize( InOutBase * ioBase, int *rows, int *cols ) *rows = *cols = 0; +#if defined( TIOCGWINSZ ) if ( isatty( ioBase->base_outfd ) ) { struct winsize win; @@ -1748,6 +1751,8 @@ static int gt_getsize( InOutBase * ioBase, int *rows, int *cols ) *cols = win.ws_col; } } +#endif + if ( *rows <= 0 || *cols <= 0 ) { char *env; @@ -1809,6 +1814,7 @@ static int gt_setsize( InOutBase * ioBase, int rows, int cols ) s_WinSizeChangeFlag = FALSE; ret = gt_resize( ioBase ); } +#if defined( TIOCGWINSZ ) else if ( isatty( ioBase->base_outfd ) ) { struct winsize win; @@ -1821,6 +1827,7 @@ static int gt_setsize( InOutBase * ioBase, int rows, int cols ) } ret = gt_resize( ioBase ); } +#endif } return ret; diff --git a/harbour/source/rtl/gttrm/gttrm.c b/harbour/source/rtl/gttrm/gttrm.c index d3d7bfd06e..f481e3cb99 100644 --- a/harbour/source/rtl/gttrm/gttrm.c +++ b/harbour/source/rtl/gttrm/gttrm.c @@ -393,6 +393,8 @@ typedef struct _HB_GTTRM /* static variables use by signal handler */ #if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) static volatile BOOL s_WinSizeChangeFlag = FALSE; +#endif +#if defined( HB_OS_UNIX_COMPATIBLE ) && defined( SA_NOCLDSTOP ) static volatile BOOL s_fRestTTY = FALSE; #endif @@ -661,7 +663,8 @@ static int hb_gt_trm_getSize( PHB_GTTRM pTerm, int * piRows, int * piCols ) { *piRows = *piCols = 0; -#if defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) +#if ( defined( HB_OS_UNIX_COMPATIBLE ) || defined( __DJGPP__ ) ) && \ + defined( TIOCGWINSZ ) if( pTerm->fOutTTY ) { struct winsize win;