diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 74b47117bc..6f602be49f 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,36 @@ The license applies to all entries newer than 2009-04-28. */ +2010-06-14 14:23 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * src/common/hbffind.c + * src/rtl/fstemp.c + * src/rtl/filesys.c + * src/rtl/fssize.c + ! Fixed to use '#define _LARGEFILE64_SOURCE 1' instead of + 'define _LARGEFILE64_SOURCE' to fix compilation on QNX. + This replaced previously added hack for stat64 in two + locations. + + * src/rtl/hbzlibgz.c + ! Protected gzungetc() and gzclearerr() calls with 'ZLIB_VERNUM >= 0x1202' + ; QNX 6.2.1 ships with zlib 1.1.3. + + * src/rtl/gttrm/gttrm.c + ! Added fix to compile when SA_RESTART is not available (in QNX). + ; TOFIX: Replace this with some more meaningful solution. + + * src/rtl/hbzlib.c + ! Fixed to compile when compressBound() is not available. + The detection is hackish because proper zlib version detection + is not available here yet. + + * src/rtl/hbznet.c + ! Fixed to build with older zlib versions where Z_RLE and/or + Z_FIXED are not available. + + * include/hbdefs.h + ! Fixed stdint handling for QNX. + 2010-06-14 11:55 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * INSTALL * include/hbsetup.h diff --git a/harbour/include/hbdefs.h b/harbour/include/hbdefs.h index 2986a7986d..f949cfd041 100644 --- a/harbour/include/hbdefs.h +++ b/harbour/include/hbdefs.h @@ -73,7 +73,7 @@ ( __DJGPP__ > 2 || ( __DJGPP__ == 2 && __DJGPP_MINOR__ >= 4 ) ) ) || \ defined( HB_OS_LINUX ) || defined( HB_OS_DARWIN ) || \ defined( HB_OS_BSD ) || defined( HB_OS_SUNOS ) || \ - defined( HB_OS_BEOS ) ) ) + defined( HB_OS_BEOS ) || defined( HB_OS_QNX ) ) ) #include /* workaround for BCC 5.8 bug */ #if ( defined( __BORLANDC__ ) && __BORLANDC__ >= 1410 ) diff --git a/harbour/src/common/hbffind.c b/harbour/src/common/hbffind.c index 2e8f14b8a9..74df88b3e5 100644 --- a/harbour/src/common/hbffind.c +++ b/harbour/src/common/hbffind.c @@ -53,7 +53,7 @@ */ #if !defined( _LARGEFILE64_SOURCE ) -# define _LARGEFILE64_SOURCE +# define _LARGEFILE64_SOURCE 1 #endif #include "hbapi.h" @@ -729,7 +729,7 @@ static HB_BOOL hb_fsFindNextLow( PHB_FFIND ffind ) { time_t ftime; struct tm lt; -#if defined( HB_USE_LARGEFILE64 ) && ! defined( HB_OS_QNX ) +#if defined( HB_USE_LARGEFILE64 ) struct stat64 sStat; if( stat64( dirname, &sStat ) == 0 ) #else diff --git a/harbour/src/rtl/filesys.c b/harbour/src/rtl/filesys.c index 726e2d120f..907172d8e9 100644 --- a/harbour/src/rtl/filesys.c +++ b/harbour/src/rtl/filesys.c @@ -95,7 +95,7 @@ /* *nixes */ #if !defined( _LARGEFILE64_SOURCE ) -# define _LARGEFILE64_SOURCE +# define _LARGEFILE64_SOURCE 1 #endif #if !defined( _GNU_SOURCE ) # define _GNU_SOURCE diff --git a/harbour/src/rtl/fssize.c b/harbour/src/rtl/fssize.c index 4c96840987..1f9e8bde53 100644 --- a/harbour/src/rtl/fssize.c +++ b/harbour/src/rtl/fssize.c @@ -52,7 +52,7 @@ */ #if !defined( _LARGEFILE64_SOURCE ) -# define _LARGEFILE64_SOURCE +# define _LARGEFILE64_SOURCE 1 #endif #include "hbapi.h" @@ -96,7 +96,7 @@ HB_FOFFSET hb_fsFSize( const char * pszFileName, HB_BOOL bUseDirEntry ) hb_fsFindClose( ffind ); return size; } -#elif defined( HB_USE_LARGEFILE64 ) && ! defined( HB_OS_QNX ) +#elif defined( HB_USE_LARGEFILE64 ) char * pszFree; HB_BOOL fResult; struct stat64 statbuf; diff --git a/harbour/src/rtl/fstemp.c b/harbour/src/rtl/fstemp.c index cca715fb60..5a74b30c4c 100644 --- a/harbour/src/rtl/fstemp.c +++ b/harbour/src/rtl/fstemp.c @@ -53,7 +53,7 @@ /* *nixes */ #if !defined( _LARGEFILE64_SOURCE ) -# define _LARGEFILE64_SOURCE +# define _LARGEFILE64_SOURCE 1 #endif #if !defined( _GNU_SOURCE ) # define _GNU_SOURCE diff --git a/harbour/src/rtl/gttrm/gttrm.c b/harbour/src/rtl/gttrm/gttrm.c index 984f0da43d..ec0d28d216 100644 --- a/harbour/src/rtl/gttrm/gttrm.c +++ b/harbour/src/rtl/gttrm/gttrm.c @@ -641,7 +641,11 @@ static void set_sig_handler( int iSig ) sigaction( iSig, 0, &act ); act.sa_handler = sig_handler; +#if defined( SA_RESTART ) act.sa_flags = SA_RESTART | ( iSig == SIGCHLD ? SA_NOCLDSTOP : 0 ); +#else + act.sa_flags = ( iSig == SIGCHLD ? SA_NOCLDSTOP : 0 ); +#endif sigaction( iSig, &act, 0 ); } diff --git a/harbour/src/rtl/hbzlib.c b/harbour/src/rtl/hbzlib.c index def43b97f9..393b4bf6aa 100644 --- a/harbour/src/rtl/hbzlib.c +++ b/harbour/src/rtl/hbzlib.c @@ -56,6 +56,13 @@ #include +/* Try to figure if we have this function. Z_RLE was introduced in 1.2.0.1, + while compressBound() was added in 1.2.0. This means we have to miss + compressBound() when using zlib 1.2.0. [vszakats] */ +#if defined( Z_RLE ) + #define _HB_Z_COMPRESSBOUND +#endif + static HB_SIZE hb_zlibUncompressedSize( const char * szSrc, HB_SIZE ulLen, int * piResult ) { @@ -112,9 +119,17 @@ HB_FUNC( HB_ZLIBVERSION ) HB_FUNC( HB_ZCOMPRESSBOUND ) { if( HB_ISCHAR( 1 ) ) +#if defined( _HB_Z_COMPRESSBOUND ) hb_retnint( compressBound( hb_parclen( 1 ) ) ); +#else + hb_retnint( 0 ); +#endif else if( HB_ISNUM( 1 ) ) +#if defined( _HB_Z_COMPRESSBOUND ) hb_retnint( compressBound( ( uLong ) hb_parnint( 1 ) ) ); +#else + hb_retnint( 0 ); +#endif else hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } @@ -172,7 +187,11 @@ HB_FUNC( HB_ZCOMPRESS ) else { ulDstLen = HB_ISNUM( 2 ) ? ( uLong ) hb_parnint( 2 ) : +#if defined( _HB_Z_COMPRESSBOUND ) compressBound( ulLen ); +#else + 0; +#endif pDest = ( char * ) hb_xalloc( ulDstLen + 1 ); } diff --git a/harbour/src/rtl/hbzlibgz.c b/harbour/src/rtl/hbzlibgz.c index 70d0fee74f..12edf6f524 100644 --- a/harbour/src/rtl/hbzlibgz.c +++ b/harbour/src/rtl/hbzlibgz.c @@ -276,9 +276,11 @@ HB_FUNC( HB_GZUNGETC ) { if( HB_ISNUM( 1 ) ) { +#if ZLIB_VERNUM >= 0x1202 gzFile gz = hb_gzParam( 2 ); if( gz ) hb_retni( gzungetc( hb_parni( 1 ), gz ) ); +#endif } else hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); @@ -372,7 +374,9 @@ HB_FUNC( HB_GZERROR ) */ HB_FUNC( HB_GZCLEARERR ) { +#if ZLIB_VERNUM >= 0x1202 gzFile gz = hb_gzParam( 1 ); if( gz ) gzclearerr( gz ); +#endif } diff --git a/harbour/src/rtl/hbznet.c b/harbour/src/rtl/hbznet.c index ccefa39bd4..6aa69dcaaa 100644 --- a/harbour/src/rtl/hbznet.c +++ b/harbour/src/rtl/hbznet.c @@ -125,9 +125,13 @@ PHB_ZNETSTREAM hb_znetOpen( int level, int strategy ) level = Z_DEFAULT_COMPRESSION; if( strategy != Z_FILTERED && - strategy != Z_HUFFMAN_ONLY && +#if defined( Z_RLE ) strategy != Z_RLE && - strategy != Z_FIXED ) +#endif +#if defined( Z_FIXED ) + strategy != Z_FIXED && +#endif + strategy != Z_HUFFMAN_ONLY ) strategy = Z_DEFAULT_STRATEGY; if( deflateInit2( &pStream->wr, level,