diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 22f3d5a661..20430e25c4 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,27 @@ 2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-04-20 14:32 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/include/hbcomp.h + * harbour/source/common/hbdate.c + * harbour/source/rtl/strmatch.c + * harbour/source/rtl/fssize.c + * harbour/source/rtl/hbffind.c + * harbour/source/rtl/filesys.c + * enabled some POSIX function added to 1.8 Linux OpenWatcom builds + and cleaned some workarounds not longer necessary + + * harbour/source/rtl/hbproces.c + + added hack with small sysconf() implementation which is still missing + in OpenWatcom 1.8. Now it's possible to build Harbour in Linux using + officially distributed OpenWatcom 1.8 + + * harbour/source/rtl/disksphb.c + * added TODO warning message + + * harbour/source/compiler/cmdcheck.c + ! fixed typo in memory freeing in repeated -p options + 2009-04-20 14:00 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * utils/hbmk2/hbmk2.prg ! Fixed to inherit .hbm dir before doing wildcard expansion. diff --git a/harbour/include/hbcomp.h b/harbour/include/hbcomp.h index 885611f3fd..65794dd928 100644 --- a/harbour/include/hbcomp.h +++ b/harbour/include/hbcomp.h @@ -57,9 +57,6 @@ #include #include #include -#if defined(__WATCOMC__) -#include /* alloca prototype */ -#endif #include "hbmacro.ch" #include "hbapi.h" diff --git a/harbour/source/common/hbdate.c b/harbour/source/common/hbdate.c index 75f7c938a1..5753e18d02 100644 --- a/harbour/source/common/hbdate.c +++ b/harbour/source/common/hbdate.c @@ -79,7 +79,7 @@ #endif #include -#if ( defined( HB_OS_BSD ) || defined( HB_OS_LINUX ) ) && !defined( __WATCOMC__ ) +#if defined( HB_OS_UNIX ) # include #elif !defined( HB_OS_WIN ) # include @@ -125,7 +125,7 @@ void hb_timeStampGetLocal( int * piYear, int * piMonth, int * piDay, struct tm st; time_t seconds, millisecs; -# if defined( HB_OS_UNIX ) && !defined( __WATCOMC__ ) +# if defined( HB_OS_UNIX ) struct timeval tv; gettimeofday( &tv, NULL ); seconds = tv.tv_sec; @@ -167,7 +167,7 @@ HB_ULONG hb_dateMilliSeconds( void ) HB_MILLISECS_PER_DAY + hb_timeEncode( st.wHour, st.wMinute, st.wSecond, st.wMilliseconds ); } -#elif defined( HB_OS_UNIX ) && !defined( __WATCOMC__ ) +#elif defined( HB_OS_UNIX ) { struct timeval tv; gettimeofday( &tv, NULL ); diff --git a/harbour/source/compiler/cmdcheck.c b/harbour/source/compiler/cmdcheck.c index 204f725a05..fa84e2fa1a 100644 --- a/harbour/source/compiler/cmdcheck.c +++ b/harbour/source/compiler/cmdcheck.c @@ -478,31 +478,29 @@ static void hb_compChkEnvironVar( HB_COMP_DECL, const char *szSwitch ) case 'o': case 'O': - { - char *szPath = hb_strdup( s + 1 ); - - HB_COMP_PARAM->pOutPath = hb_fsFNameSplit( szPath ); - hb_xfree( szPath ); + HB_COMP_PARAM->pOutPath = hb_fsFNameSplit( s + 1 ); break; - } /* Added for preprocessor needs */ case 'p': case 'P': if( s[ 1 ] == '+' && s[ 2 ] == '\0' ) HB_COMP_PARAM->fPPT = TRUE; - else if( s[ 1 ] == '-' && s[ 2 ] == '\0' ) - HB_COMP_PARAM->fPPO = FALSE; else { if( HB_COMP_PARAM->pPpoPath ) { - HB_COMP_PARAM->pPpoPath = NULL; hb_xfree( HB_COMP_PARAM->pPpoPath ); + HB_COMP_PARAM->pPpoPath = NULL; + } + if( s[ 1 ] == '-' && s[ 2 ] == '\0' ) + HB_COMP_PARAM->fPPO = FALSE; + else + { + if( s[ 1 ] ) + HB_COMP_PARAM->pPpoPath = hb_fsFNameSplit( s + 1 ); + HB_COMP_PARAM->fPPO = TRUE; } - if( s[ 1 ] ) - HB_COMP_PARAM->pPpoPath = hb_fsFNameSplit( s + 1 ); - HB_COMP_PARAM->fPPO = TRUE; } break; diff --git a/harbour/source/rtl/disksphb.c b/harbour/source/rtl/disksphb.c index afeda0f4d1..cfed57106e 100644 --- a/harbour/source/rtl/disksphb.c +++ b/harbour/source/rtl/disksphb.c @@ -374,6 +374,8 @@ HB_FUNC( HB_DISKSPACE ) } #else { + int iTODO; + HB_SYMBOL_UNUSED( szPath ); HB_SYMBOL_UNUSED( uiType ); } diff --git a/harbour/source/rtl/filesys.c b/harbour/source/rtl/filesys.c index a44925120b..903a6adc6b 100644 --- a/harbour/source/rtl/filesys.c +++ b/harbour/source/rtl/filesys.c @@ -1831,7 +1831,7 @@ void hb_fsCommit( HB_FHANDLE hFileHandle ) * original or duplicated file handle */ hb_vmUnlock(); - #if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO + 0 > 0 + #if defined( _POSIX_SYNCHRONIZED_IO ) /* faster - flushes data buffers only, without updating directory info */ hb_fsSetIOError( fdatasync( hFileHandle ) == 0, 0 ); diff --git a/harbour/source/rtl/fssize.c b/harbour/source/rtl/fssize.c index debb2f83dd..56de02ab72 100644 --- a/harbour/source/rtl/fssize.c +++ b/harbour/source/rtl/fssize.c @@ -72,7 +72,7 @@ * on 32bit machines. */ #define HB_USE_LARGEFILE64 - #elif defined( HB_OS_UNIX ) && defined( O_LARGEFILE ) && ! defined( __WATCOMC__ ) + #elif defined( HB_OS_UNIX ) && defined( O_LARGEFILE ) #define HB_USE_LARGEFILE64 #endif #endif diff --git a/harbour/source/rtl/hbffind.c b/harbour/source/rtl/hbffind.c index cce8fb8dc7..4d67f7ffb1 100644 --- a/harbour/source/rtl/hbffind.c +++ b/harbour/source/rtl/hbffind.c @@ -165,7 +165,7 @@ * on 32bit machines. */ #define HB_USE_LARGEFILE64 - #elif defined( HB_OS_UNIX ) && defined( O_LARGEFILE ) && ! defined( __WATCOMC__ ) + #elif defined( HB_OS_UNIX ) && defined( O_LARGEFILE ) #define HB_USE_LARGEFILE64 #endif #endif diff --git a/harbour/source/rtl/hbproces.c b/harbour/source/rtl/hbproces.c index a06b132474..9188010946 100644 --- a/harbour/source/rtl/hbproces.c +++ b/harbour/source/rtl/hbproces.c @@ -735,3 +735,20 @@ BOOL hb_fsProcessClose( HB_FHANDLE hProcess, BOOL fGentle ) #endif return fResult; } + +/* small hack for still missing sysconf() in Watcom 1.8 */ +#if defined( HB_OS_LINUX ) && defined( __WATCOMC__ ) +_WCRTLINK long sysconf( int __name ) +{ + switch( __name ) + { + case _SC_OPEN_MAX: + return 1024; + case _SC_CLK_TCK: + return 100; + case /* _SC_PAGE_SIZE */ 30: + return 4096; + } + return -1; +} +#endif diff --git a/harbour/source/rtl/strmatch.c b/harbour/source/rtl/strmatch.c index 364d3f7e60..eb972baec4 100644 --- a/harbour/source/rtl/strmatch.c +++ b/harbour/source/rtl/strmatch.c @@ -53,7 +53,7 @@ #include "hbapi.h" #include "hbregex.h" -#if defined( HB_OS_UNIX ) && !defined( __WATCOMC__ ) +#if defined( HB_OS_UNIX ) && !defined( HB_NO_FNMATCH ) # include #endif @@ -293,7 +293,7 @@ BOOL hb_strMatchRegExp( const char * szString, const char * szPattern ) BOOL hb_strMatchFile( const char * szString, const char * szPattern ) { #if defined( HB_OS_UNIX ) -# if defined( __WATCOMC__ ) +# if defined( HB_NO_FNMATCH ) return hb_strMatchWildExact( szString, szPattern ); # else return fnmatch( szPattern, szString, FNM_PERIOD | FNM_PATHNAME ) == 0;