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
This commit is contained in:
Przemyslaw Czerpak
2009-08-11 11:15:54 +00:00
parent df701b0ac9
commit b5d78f6c44
3 changed files with 37 additions and 14 deletions

View File

@@ -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

View File

@@ -64,10 +64,6 @@
#define __PLATFORM__LINUX
#endif
#xtranslate hb_gtSys => gtSys
#xtranslate hb_gtInfo([<x,...>]) => gtInfo(<x>)
#xtranslate hb_gtVersion([<x>]) => hb_gt_Version(<x>)
#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([<x,...>]) => hb_gtInfo(<x>)
#xtranslate hb_gt_Version([<x>]) => hb_gtVersion(<x>)
#xtranslate gtSetClipboard(<x>) => hb_gtInfo( HB_GTI_CLIPBOARDDATA, <x> )
#xtranslate gtGetClipboard() => hb_gtInfo( HB_GTI_CLIPBOARDDATA )
#xtranslate gtGetClipBoardSize() => Len( hb_gtInfo( HB_GTI_CLIPBOARDDATA ) )

View File

@@ -64,6 +64,16 @@
#include <unistd.h> /* 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;