From 4acf8c4c16610dce90182b1d73a0f282636ff52b Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Fri, 29 Oct 2010 12:50:19 +0000 Subject: [PATCH] 2010-10-29 14:50 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/rtl/hbcom.c * added patches created by Tamas TEVESZ and default port name for AIX --- harbour/ChangeLog | 5 +++++ harbour/src/rtl/hbcom.c | 15 +++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c0c92700ea..33a34e08ea 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,11 @@ The license applies to all entries newer than 2009-04-28. */ +2010-10-29 14:50 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/src/rtl/hbcom.c + * added patches created by Tamas TEVESZ + and default port name for AIX + 2010-10-29 14:00 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg + Platform/compiler checks made robust and don't diff --git a/harbour/src/rtl/hbcom.c b/harbour/src/rtl/hbcom.c index 97c1bd2790..cda20a6992 100644 --- a/harbour/src/rtl/hbcom.c +++ b/harbour/src/rtl/hbcom.c @@ -77,7 +77,7 @@ # define BSD_COMP # endif # endif -#elif defined( HB_OS_DOS ) && 1 +#elif defined( HB_OS_DOS ) # define HB_HAS_PMCOM #endif @@ -183,19 +183,17 @@ static const char * hb_comGetName( PHB_COM pCom, char * buffer, int size ) hb_snprintf( buffer, size, "/dev/tty%c", pCom->port + 'a' - 1 ); # elif defined( HB_OS_HPUX ) hb_snprintf( buffer, size, "/dev/tty%dp0", pCom->port ); +# elif defined( HB_OS_AIX ) + hb_snprintf( buffer, size, "/dev/tty%d", pCom->port ); # elif defined( HB_OS_IRIX ) hb_snprintf( buffer, size, "/dev/ttyf%d", pCom->port ); # elif defined( HB_OS_DIGITAL_UNIX ) - hb_snprintf( buffer, size, "/dev/tty%02d", pCom->port ); + hb_snprintf( buffer, size, "/dev/ttyf%02d", pCom->port ); # elif defined( HB_OS_DARWIN ) hb_snprintf( buffer, size, "/dev/cuaa%d", pCom->port - 1 ); # else /* defined( HB_OS_LINUX ) || defined( HB_OS_CYGWIN ) || ... */ hb_snprintf( buffer, size, "/dev/ttyS%d", pCom->port - 1 ); # endif - /* other OS-es: - * IRIX: "/dev/ttyf%d" (1-based) - * Digital UNIX: "/dev/ttyf%02d" (1-based) - */ #else if( hb_iswinnt() ) hb_snprintf( buffer, size, "\\\\.\\COM%d", pCom->port ); @@ -458,6 +456,11 @@ int hb_comOutputCount( int iPort ) if( iResult == -1 ) iCount = 0; hb_comSetOsError( pCom, iResult == -1 ); +#elif defined( FIONWRITE ) + int iResult = ioctl( pCom->fd, FIONWRITE, &iCount ); + if( iResult == -1 ) + iCount = 0; + hb_comSetOsError( pCom, iResult == -1 ); #else int TODO_TIOCOUTQ; hb_comSetComError( pCom, HB_COM_ERR_NOSUPPORT );