diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 88f8eb467b..627f81c3f8 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,16 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-08-11 13:15 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/rtl/fstemp.c + * enabled mkstmp() in SunOS builds (is it supported by MacOSX?) + + added optional support for mkstemps() - it's disabled by default + + * harbour/contrib/xhb/hbcompat.ch + ! removed some old not longer valid translations + xHarbour developers should copy current hbcompat.ch from + Harbour SVN to xHarbour CVS + 2009-08-11 13:00 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/bsd/gcc.cf * config/wce/msvcarm.cf diff --git a/harbour/contrib/xhb/hbcompat.ch b/harbour/contrib/xhb/hbcompat.ch index 055ca54585..36c0676c0a 100644 --- a/harbour/contrib/xhb/hbcompat.ch +++ b/harbour/contrib/xhb/hbcompat.ch @@ -64,10 +64,6 @@ #define __PLATFORM__LINUX #endif - #xtranslate hb_gtSys => gtSys - #xtranslate hb_gtInfo([]) => gtInfo() - #xtranslate hb_gtVersion([]) => hb_gt_Version() - #xtranslate hb_ScrMaxRow() => gtInfo( HB_GTI_SCREENHEIGHT ) #xtranslate hb_ScrMaxCol() => gtInfo( HB_GTI_SCREENWIDTH ) #xtranslate MaxRow(.T.) => gtInfo( HB_GTI_SCREENHEIGHT ) @@ -236,10 +232,6 @@ #define GTI_CLIENT 2 /* Maximum possible client size of a window */ #define GTI_MAX 3 /* Maximum possible window size (in Windows) */ - #xtranslate gtSys => hb_gtSys - #xtranslate gtInfo([]) => hb_gtInfo() - #xtranslate hb_gt_Version([]) => hb_gtVersion() - #xtranslate gtSetClipboard() => hb_gtInfo( HB_GTI_CLIPBOARDDATA, ) #xtranslate gtGetClipboard() => hb_gtInfo( HB_GTI_CLIPBOARDDATA ) #xtranslate gtGetClipBoardSize() => Len( hb_gtInfo( HB_GTI_CLIPBOARDDATA ) ) diff --git a/harbour/source/rtl/fstemp.c b/harbour/source/rtl/fstemp.c index 8afb3326e5..6b9a125c3a 100644 --- a/harbour/source/rtl/fstemp.c +++ b/harbour/source/rtl/fstemp.c @@ -64,6 +64,16 @@ #include /* We need for mkstemp() on BSD */ #endif +#if ( defined( HB_OS_LINUX ) && !defined( __WATCOMC__ ) ) || \ + defined( HB_OS_BSD ) || \ + defined( HB_OS_SUNOS ) +# define HB_HAS_MKSTEMP + /* some platforms supports also mkstemps() and for them we can + * set HB_HAS_MKSTEMPS macro but without autoconf it's hard to + * detect if mkstemps() is available [druzus] + */ +#endif + #if !defined( HB_OS_WIN ) static BOOL fsGetTempDirByCase( char * pszName, const char * pszTempDir ) { @@ -159,21 +169,32 @@ static HB_FHANDLE hb_fsCreateTempLow( const char * pszDir, const char * pszPrefi if( iLen > ( HB_PATH_MAX - 1 ) - 6 ) return FS_ERROR; -#if !defined( __WATCOMC__ ) && ( defined( HB_OS_LINUX ) || defined( HB_OS_BSD ) ) +#if defined( HB_HAS_MKSTEMP ) if( hb_setGetFileCase() != HB_SET_CASE_LOWER && hb_setGetFileCase() != HB_SET_CASE_UPPER && hb_setGetDirCase() != HB_SET_CASE_LOWER && - hb_setGetDirCase() != HB_SET_CASE_UPPER && - pszExt == NULL ) + hb_setGetDirCase() != HB_SET_CASE_UPPER +#if !defined( HB_HAS_MKSTEMPS ) + && ( pszExt == NULL || *pszExt == 0 ) +#endif + ) { - hb_strncat( pszName, "XXXXXX", HB_PATH_MAX - 1 ); hb_vmUnlock(); - fd = ( HB_FHANDLE ) mkstemp( pszName ); + hb_strncat( pszName, "XXXXXX", HB_PATH_MAX - 1 ); +#if defined( HB_HAS_MKSTEMPS ) + if( pszExt && *pszExt ) + { + hb_strncat( pszName, pszExt, HB_PATH_MAX - 1 ); + fd = ( HB_FHANDLE ) mkstemps( pszName, ( int ) strlen( pszExt ) ); + } + else +#endif + fd = ( HB_FHANDLE ) mkstemp( pszName ); hb_fsSetIOError( fd != ( HB_FHANDLE ) -1, 0 ); hb_vmLock(); } else -#endif +#endif /* HB_HAS_MKSTEMP */ { int i, n; double d = hb_random_num(), x;