2009-08-14 09:34 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* source/rtl/gtsln/gtsln.c
    ! Fixed linux/gcc warning. Now write() retval is checked.

  * config/global.cf
    ! Fixed wrong autodetection due to recent change.
      (HB_COMPILER needs to be checked against empty value)
This commit is contained in:
Viktor Szakats
2009-08-14 07:35:18 +00:00
parent 11f8e54b17
commit 34b7c959d4
3 changed files with 73 additions and 60 deletions

View File

@@ -17,6 +17,14 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-08-14 09:34 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* source/rtl/gtsln/gtsln.c
! Fixed linux/gcc warning. Now write() retval is checked.
* config/global.cf
! Fixed wrong autodetection due to recent change.
(HB_COMPILER needs to be checked against empty value)
2009-08-14 08:41 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* INSTALL
* make_gnu.bat

View File

@@ -421,20 +421,22 @@ endif
HB_ARCH_AUTO :=
ifeq ($(HB_ARCHITECTURE),)
HB_ARCHITECTURE := $(HB_HOST_ARCH)
ifeq ($(HB_COMPILER),msvcarm)
HB_ARCHITECTURE := wce
else
ifeq ($(HB_COMPILER),mingwarm)
ifneq ($(HB_COMPILER),)
ifeq ($(HB_COMPILER),msvcarm)
HB_ARCHITECTURE := wce
else
ifeq ($(HB_COMPILER),poccarm)
ifeq ($(HB_COMPILER),mingwarm)
HB_ARCHITECTURE := wce
else
ifeq ($(HB_COMPILER),djgpp)
HB_ARCHITECTURE := dos
ifeq ($(HB_COMPILER),poccarm)
HB_ARCHITECTURE := wce
else
ifeq ($(findstring $(HB_COMPILER),mingw mingw64 msvc msvc64 msvcia64 bcc xcc pocc pocc64),)
HB_ARCHITECTURE := win
ifeq ($(HB_COMPILER),djgpp)
HB_ARCHITECTURE := dos
else
ifeq ($(findstring $(HB_COMPILER),mingw mingw64 msvc msvc64 msvcia64 bcc xcc pocc pocc64),)
HB_ARCHITECTURE := win
endif
endif
endif
endif

View File

@@ -538,71 +538,74 @@ static int hb_sln_isUTF8( int iStdOut, int iStdIn )
if( isatty( iStdOut ) && isatty( iStdIn ) )
{
const char * szBuf = "\r\303\255\033[6n \r";
char rdbuf[ 64 ];
int i, j, n, d, y, x;
HB_ULONG end_timer, time;
int len = strlen( szBuf );
write( iStdOut, szBuf, strlen( szBuf ) );
n = j = x = y = 0;
/* wait up to 2 seconds for answer */
end_timer = hb_dateMilliSeconds() + 2000;
for( ; ; )
if( write( iStdOut, szBuf, len ) == len )
{
/* loking for cursor position in "\033[%d;%dR" */
while( j < n && rdbuf[ j ] != '\033' )
++j;
if( n - j >= 6 )
char rdbuf[ 64 ];
int i, j, n, d, y, x;
HB_ULONG end_timer, time;
n = j = x = y = 0;
/* wait up to 2 seconds for answer */
end_timer = hb_dateMilliSeconds() + 2000;
for( ; ; )
{
i = j + 1;
if( rdbuf[ i ] == '[' )
/* loking for cursor position in "\033[%d;%dR" */
while( j < n && rdbuf[ j ] != '\033' )
++j;
if( n - j >= 6 )
{
y = 0;
d = ++i;
while( i < n && rdbuf[ i ] >= '0' && rdbuf[ i ] <= '9' )
y = y * 10 + ( rdbuf[ i++ ] - '0' );
if( i < n && i > d && rdbuf[ i ] == ';' )
i = j + 1;
if( rdbuf[ i ] == '[' )
{
x = 0;
y = 0;
d = ++i;
while( i < n && rdbuf[ i ] >= '0' && rdbuf[ i ] <= '9' )
x = x * 10 + ( rdbuf[ i++ ] - '0' );
if( i < n && i > d && rdbuf[ i ] == 'R' )
y = y * 10 + ( rdbuf[ i++ ] - '0' );
if( i < n && i > d && rdbuf[ i ] == ';' )
{
return x == 2 ? 1 : 0;
x = 0;
d = ++i;
while( i < n && rdbuf[ i ] >= '0' && rdbuf[ i ] <= '9' )
x = x * 10 + ( rdbuf[ i++ ] - '0' );
if( i < n && i > d && rdbuf[ i ] == 'R' )
{
return x == 2 ? 1 : 0;
}
}
}
if( i < n )
{
j = i;
continue;
}
}
if( i < n )
if( n == sizeof( rdbuf ) )
break;
time = hb_dateMilliSeconds();
if( time > end_timer )
break;
else
{
j = i;
continue;
struct timeval tv;
fd_set rdfds;
int iMilliSec;
FD_ZERO( &rdfds );
FD_SET( iStdIn, &rdfds );
iMilliSec = ( int ) ( end_timer - time );
tv.tv_sec = iMilliSec / 1000;
tv.tv_usec = ( iMilliSec % 1000 ) * 1000;
if( select( iStdIn + 1, &rdfds, NULL, NULL, &tv ) <= 0 )
break;
i = read( iStdIn, rdbuf + n, sizeof( rdbuf ) - n );
if( i <= 0 )
break;
n += i;
}
}
if( n == sizeof( rdbuf ) )
break;
time = hb_dateMilliSeconds();
if( time > end_timer )
break;
else
{
struct timeval tv;
fd_set rdfds;
int iMilliSec;
FD_ZERO( &rdfds );
FD_SET( iStdIn, &rdfds );
iMilliSec = ( int ) ( end_timer - time );
tv.tv_sec = iMilliSec / 1000;
tv.tv_usec = ( iMilliSec % 1000 ) * 1000;
if( select( iStdIn + 1, &rdfds, NULL, NULL, &tv ) <= 0 )
break;
i = read( iStdIn, rdbuf + n, sizeof( rdbuf ) - n );
if( i <= 0 )
break;
n += i;
}
}
}
return -1;