diff --git a/ChangeLog.txt b/ChangeLog.txt index f001108c82..9adf5ee6bc 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,15 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2014-11-21 16:31 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * contrib/gtqtc/gtqtc.hbc + * contrib/gtqtc/gtqtc.hbp + ! fixed detecting QT when both QT4 and GT5 versions are installed + in OSX (synced with Viktor's branch) + + * src/rtl/gttrm/gttrm.c + * small modification for future usage + 2014-11-21 13:40 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * src/rtl/replic.c % optimized REPLICATE() function diff --git a/contrib/gtqtc/gtqtc.hbc b/contrib/gtqtc/gtqtc.hbc index 7b9d36f971..abf732e402 100644 --- a/contrib/gtqtc/gtqtc.hbc +++ b/contrib/gtqtc/gtqtc.hbc @@ -5,20 +5,24 @@ gt=${_HB_DYNPREF}${hb_name}${_HB_DYNSUFF} depcontrol=qt5:${HB_WITH_QT} depkeyhead=qt5:QtCore/QJsonObject depoptional=qt5:yes +depincpath=qt5:/usr/local/opt/qt5/include{darwin} depfinish=qt5 -{darwin}depcontrol=qt:${HB_WITH_QT} -{darwin}depkeyhead=qt:QtCore/qglobal.h -{darwin}depincpath=qt:/Developer/qt/include -{darwin}depincpath=qt:/Library/Frameworks -{darwin}depincpath=qt:/usr/local/include -{darwin}depfinish=qt +{!HBMK_HAS_QT5&darwin}depcontrol=qt:${HB_WITH_QT} +{!HBMK_HAS_QT5&darwin}depkeyhead=qt:QtCore/qglobal.h +{!HBMK_HAS_QT5&darwin}depincpath=qt:/Developer/qt/include +{!HBMK_HAS_QT5&darwin}depincpath=qt:/Library/Frameworks +{!HBMK_HAS_QT5&darwin}depincpath=qt:/usr/local/include +{!HBMK_HAS_QT5&darwin}depfinish=qt {(allwin|os2)|HB_WITH_QT}libpaths=${HB_WITH_QT}/../lib {(allwin|os2)&!HBMK_HAS_QT5}libs=QtCore4 QtGui4 {(allwin|os2|linux|beos|symbian)&HBMK_HAS_QT5}libs=Qt5Core Qt5Gui Qt5Widgets {(linux|beos|symbian)&!HBMK_HAS_QT5}libs=QtCore QtGui -{darwin}ldflags=-F${HBMK_DIR_QT}/../lib +{!HBMK_HAS_QT5&darwin}ldflags=-F${HBMK_DIR_QT}/../lib +{!HBMK_HAS_QT5&darwin}dflags=-F${HBMK_DIR_QT}/../lib +{HBMK_HAS_QT5&darwin}ldflags=-F${HBMK_DIR_QT5}/../lib +{HBMK_HAS_QT5&darwin}dflags=-F${HBMK_DIR_QT5}/../lib {darwin}frameworks=QtCore QtGui {darwin&HBMK_HAS_QT5}frameworks=QtWidgets {(bsd|darwin)}libs=stdc++ diff --git a/contrib/gtqtc/gtqtc.hbp b/contrib/gtqtc/gtqtc.hbp index b488c2b47b..a0c087f51c 100644 --- a/contrib/gtqtc/gtqtc.hbp +++ b/contrib/gtqtc/gtqtc.hbp @@ -14,9 +14,10 @@ -depcontrol=qt5:${HB_WITH_QT} -depkeyhead=qt5:QtCore/QJsonObject -depoptional=qt5:yes +-depincpath=qt5:/usr/local/opt/qt5/include{darwin} -depfinish=qt5 -{!HBMK_HAS_QT5&!android}-deppkgname=qt:QtCore +{!HBMK_HAS_QT5&!darwin&!android}-deppkgname=qt:QtCore {!HBMK_HAS_QT5}-depkeyhead=qt:QtCore/qglobal.h {!HBMK_HAS_QT5}-depcontrol=qt:${HB_WITH_QT} {!HBMK_HAS_QT5&HB_BUILD_3RDEXT='no'}-depcontrol=qt:no @@ -25,9 +26,9 @@ {!HBMK_HAS_QT5&!darwin&!android}-depincpath=qt:/usr/include {!HBMK_HAS_QT5&bsd}-depincpath=qt:/usr/local/include/qt4 {!HBMK_HAS_QT5&beos}-depincpath=qt:/boot/common/include -{darwin}-depincpath=qt:/Developer/qt/include -{darwin}-depincpath=qt:/Library/Frameworks -{darwin}-depincpath=qt:/usr/local/include +{!HBMK_HAS_QT5&darwin}-depincpath=qt:/Developer/qt/include +{!HBMK_HAS_QT5&darwin}-depincpath=qt:/Library/Frameworks +{!HBMK_HAS_QT5&darwin}-depincpath=qt:/usr/local/include gtqtc1.cpp gtqtc.h diff --git a/src/rtl/gttrm/gttrm.c b/src/rtl/gttrm/gttrm.c index fc82416cb2..988959532f 100644 --- a/src/rtl/gttrm/gttrm.c +++ b/src/rtl/gttrm/gttrm.c @@ -1063,6 +1063,32 @@ static void mouse_exit( PHB_GTTRM pTerm ) #endif } +static int read_bufch( PHB_GTTRM pTerm, int fd ) +{ + int n = 0, i; + + if( STDIN_BUFLEN > pTerm->stdin_inbuf ) + { + unsigned char buf[ STDIN_BUFLEN ]; + +#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) + n = read( fd, buf, STDIN_BUFLEN - pTerm->stdin_inbuf ); +#else + n = hb_fsRead( fd, buf, STDIN_BUFLEN - pTerm->stdin_inbuf ); +#endif + + for( i = 0; i < n; i++ ) + { + pTerm->stdin_buf[ pTerm->stdin_ptr_r++ ] = buf[ i ]; + if( pTerm->stdin_ptr_r == STDIN_BUFLEN ) + pTerm->stdin_ptr_r = 0; + pTerm->stdin_inbuf++; + } + } + + return n; +} + static int get_inch( PHB_GTTRM pTerm, int milisec ) { int nRet = 0, npfd = -1, nchk = pTerm->efds_no, lRead = 0; @@ -1120,28 +1146,9 @@ static int get_inch( PHB_GTTRM pTerm, int milisec ) if( pTerm->event_fds[ i ]->eventFunc == NULL ) { lRead = 1; - if( STDIN_BUFLEN > pTerm->stdin_inbuf ) - { - unsigned char buf[ STDIN_BUFLEN ]; - -#if defined( HB_OS_UNIX ) || defined( __DJGPP__ ) - n = read( pTerm->event_fds[ i ]->fd, buf, - STDIN_BUFLEN - pTerm->stdin_inbuf ); -#else - n = hb_fsRead( pTerm->event_fds[ i ]->fd, buf, - STDIN_BUFLEN - pTerm->stdin_inbuf ); -#endif - if( n == 0 ) - pTerm->event_fds[ i ]->status = EVTFDSTAT_STOP; - else - for( i = 0; i < n; i++ ) - { - pTerm->stdin_buf[ pTerm->stdin_ptr_r++ ] = buf[ i ]; - if( pTerm->stdin_ptr_r == STDIN_BUFLEN ) - pTerm->stdin_ptr_r = 0; - pTerm->stdin_inbuf++; - } - } + n = read_bufch( pTerm, pTerm->event_fds[ i ]->fd ); + if( n == 0 ) + pTerm->event_fds[ i ]->status = EVTFDSTAT_STOP; } else if( nRet == 0 && counter == pTerm->key_counter ) {