2007-11-22 01:44 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/source/rtl/fssize.c
  * harbour/source/rtl/hbffind.c
  * harbour/source/rtl/filesys.c
    * set _LARGEFILE64_SOURCE in all builds and use HB_USE_LARGEFILE64
      macro (set automatically when __USE_LARGEFILE64 is defined too or
      HB_OS_HPUX && O_LARGEFILE) to enable large file support in 32 bit
      POSIX systems. It should help to enable large file support in other
      then Linux different 32 bit *nixes.
      I hope it will resolve Sandro problems with HPUX.

  * harbour/source/vm/itemapi.c
    * do not return DATE item value in hb_itemGetNDDec()
      It was old and unused xHarbour only code - now hb_itemGetNDDec()
      is compatible with hb_itemGetND()

  * harbour/source/rtl/seconds.c
    ! fixed typo in BSD builds
      BTW can someone test current SVN code with Solaris?
      I will not be able to make such test myself in the nearest few weeks.
This commit is contained in:
Przemyslaw Czerpak
2007-11-22 00:44:50 +00:00
parent 08bedc38bb
commit 6b02648ff2
6 changed files with 73 additions and 49 deletions

View File

@@ -8,6 +8,27 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-11-22 01:44 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/rtl/fssize.c
* harbour/source/rtl/hbffind.c
* harbour/source/rtl/filesys.c
* set _LARGEFILE64_SOURCE in all builds and use HB_USE_LARGEFILE64
macro (set automatically when __USE_LARGEFILE64 is defined too or
HB_OS_HPUX && O_LARGEFILE) to enable large file support in 32 bit
POSIX systems. It should help to enable large file support in other
then Linux different 32 bit *nixes.
I hope it will resolve Sandro problems with HPUX.
* harbour/source/vm/itemapi.c
* do not return DATE item value in hb_itemGetNDDec()
It was old and unused xHarbour only code - now hb_itemGetNDDec()
is compatible with hb_itemGetND()
* harbour/source/rtl/seconds.c
! fixed typo in BSD builds
BTW can someone test current SVN code with Solaris?
I will not be able to make such test myself in the nearest few weeks.
2007-11-21 21:45 UTC+0100 Marek Paliwoda (mpaliwoda at interia pl)
* harbour/contrib/mtpl_defs.mak
* harbour/contrib/mtpl_b32.mak

View File

@@ -90,7 +90,7 @@
This has been corrected by ptucker
*/
#if defined(HB_OS_LINUX)
#if !defined( _LARGEFILE64_SOURCE )
# define _LARGEFILE64_SOURCE
#endif
@@ -166,9 +166,7 @@
#include <fcntl.h>
#endif
#if defined(HB_OS_HPUX)
extern int fdatasync(int fildes);
#elif defined(HB_OS_DOS)
#if defined(HB_OS_DOS)
#include <dos.h>
#elif defined(HB_OS_OS2)
#include <sys/signal.h>
@@ -190,6 +188,19 @@
#include <sys/file.h>
#endif
#if !defined( HB_USE_LARGEFILE64 ) && defined( OS_UNIX_COMPATIBLE )
#if defined( __USE_LARGEFILE64 )
/*
* The macro: __USE_LARGEFILE64 is set when _LARGEFILE64_SOURCE is
* define and efectively enables lseek64/flock64/ftruncate64 functions
* on 32bit machines.
*/
#define HB_USE_LARGEFILE64
#elif defined( HB_OS_HPUX ) && defined( O_LARGEFILE )
#define HB_USE_LARGEFILE64
#endif
#endif
#if defined(OS_HAS_DRIVE_LETTER)
/* 27/08/2004 - <maurilio.longo@libero.it>
HB_FS_GETDRIVE() should return a number in the range 0..25 ('A'..'Z')
@@ -970,12 +981,7 @@ HB_EXPORT USHORT hb_fsWrite( FHANDLE hFileHandle, const BYTE * pBuff, USHORT uiC
}
else
{
#if defined(HB_OS_LINUX) && defined(__USE_LARGEFILE64)
/*
* The macro: __USE_LARGEFILE64 is set when _LARGEFILE64_SOURCE is
* define and efectively enables lseek64/flock64/ftruncate64 functions
* on 32bit machines.
*/
#if defined(HB_USE_LARGEFILE64)
hb_fsSetIOError( ftruncate64( hFileHandle, lseek64( hFileHandle, 0L, SEEK_CUR ) ) != -1, 0 );
#else
hb_fsSetIOError( ftruncate( hFileHandle, lseek( hFileHandle, 0L, SEEK_CUR ) ) != -1, 0 );
@@ -1140,12 +1146,7 @@ HB_EXPORT ULONG hb_fsWriteLarge( FHANDLE hFileHandle, const BYTE * pBuff, ULONG
#endif
else
{
#if defined(HB_OS_LINUX) && defined(__USE_LARGEFILE64)
/*
* The macro: __USE_LARGEFILE64 is set when _LARGEFILE64_SOURCE is
* define and efectively enables lseek64/flock64/ftruncate64 functions
* on 32bit machines.
*/
#if defined(HB_USE_LARGEFILE64)
hb_fsSetIOError( ftruncate64( hFileHandle, lseek64( hFileHandle, 0L, SEEK_CUR ) ) != -1, 0 );
#else
hb_fsSetIOError( ftruncate( hFileHandle, lseek( hFileHandle, 0L, SEEK_CUR ) ) != -1, 0 );
@@ -1493,12 +1494,7 @@ HB_EXPORT BOOL hb_fsLockLarge( FHANDLE hFileHandle, HB_FOFFSET ulStart,
}
hb_fsSetIOError( bResult, 0 );
}
#elif defined(HB_OS_LINUX) && defined(__USE_LARGEFILE64)
/*
* The macro: __USE_LARGEFILE64 is set when _LARGEFILE64_SOURCE is
* define and efectively enables lseek64/flock64/ftruncate64 functions
* on 32bit machines.
*/
#elif defined(HB_USE_LARGEFILE64)
{
struct flock64 lock_info;
@@ -1659,12 +1655,7 @@ HB_EXPORT HB_FOFFSET hb_fsSeekLarge( FHANDLE hFileHandle, HB_FOFFSET llOffset, U
llPos = ( ( HB_FOFFSET ) ulOffsetHigh << 32 ) | ulOffsetLow;
}
}
#elif defined(HB_OS_LINUX) && defined(__USE_LARGEFILE64)
/*
* The macro: __USE_LARGEFILE64 is set when _LARGEFILE64_SOURCE is
* define and efectively enables lseek64/flock64/ftruncate64 functions
* on 32bit machines.
*/
#elif defined(HB_USE_LARGEFILE64)
{
USHORT Flags = convert_seek_flags( uiFlags );

View File

@@ -51,7 +51,7 @@
*
*/
#if defined(HB_OS_LINUX)
#if !defined( _LARGEFILE64_SOURCE )
# define _LARGEFILE64_SOURCE
#endif
@@ -63,6 +63,20 @@
# include <sys/stat.h>
#endif
#if !defined( HB_USE_LARGEFILE64 ) && defined( OS_UNIX_COMPATIBLE )
#if defined( __USE_LARGEFILE64 )
/*
* The macro: __USE_LARGEFILE64 is set when _LARGEFILE64_SOURCE is
* define and efectively enables lseek64/flock64/ftruncate64 functions
* on 32bit machines.
*/
#define HB_USE_LARGEFILE64
#elif defined( HB_OS_HPUX ) && defined( O_LARGEFILE )
#define HB_USE_LARGEFILE64
#endif
#endif
HB_FOFFSET hb_fsFSize( BYTE * pszFileName, BOOL bUseDirEntry )
{
if( bUseDirEntry )
@@ -81,12 +95,7 @@ HB_FOFFSET hb_fsFSize( BYTE * pszFileName, BOOL bUseDirEntry )
hb_fsFindClose( ffind );
return size;
}
#elif defined(HB_OS_LINUX) && defined(__USE_LARGEFILE64)
/*
* The macro: __USE_LARGEFILE64 is set when _LARGEFILE64_SOURCE is
* define and efectively enables lseek64/flock64/ftruncate64 functions
* on 32bit machines.
*/
#elif defined( HB_USE_LARGEFILE64 )
BOOL fResult, fFree;
struct stat64 statbuf;
pszFileName = hb_fsNameConv( pszFileName, &fFree );

View File

@@ -52,7 +52,7 @@
*
*/
#if defined(HB_OS_LINUX)
#if !defined( _LARGEFILE64_SOURCE )
# define _LARGEFILE64_SOURCE
#endif
@@ -164,6 +164,19 @@ HB_FILE_VER( "$Id$" )
#endif
#if !defined( HB_USE_LARGEFILE64 ) && defined( OS_UNIX_COMPATIBLE )
#if defined( __USE_LARGEFILE64 )
/*
* The macro: __USE_LARGEFILE64 is set when _LARGEFILE64_SOURCE is
* define and efectively enables lseek64/flock64/ftruncate64 functions
* on 32bit machines.
*/
#define HB_USE_LARGEFILE64
#elif defined( HB_OS_HPUX ) && defined( O_LARGEFILE )
#define HB_USE_LARGEFILE64
#endif
#endif
/* ------------------------------------------------------------- */
USHORT hb_fsAttrFromRaw( ULONG raw_attr )
@@ -677,12 +690,7 @@ static BOOL hb_fsFindNextLow( PHB_FFIND ffind )
{
time_t ftime;
struct tm * ft;
#if defined(HB_OS_LINUX) && defined(__USE_LARGEFILE64)
/*
* The macro: __USE_LARGEFILE64 is set when _LARGEFILE64_SOURCE is
* define and efectively enables lseek64/flock64/ftruncate64 functions
* on 32bit machines.
*/
#if defined( HB_USE_LARGEFILE64 )
struct stat64 sStat;
if( stat64( dirname, &sStat ) == 0 )
#else

View File

@@ -110,7 +110,7 @@ HB_EXPORT void hb_dateTimeStamp( LONG * plJulian, LONG * plMilliSec )
st = localtime( &seconds );
*plJulian = hb_dateEncode( st->tm_year + 1900, st->tm_mon + 1, st->tm_mday );
*plMilliSec = ( ( st->tm_hour * 60 + st->tm_min ) * 60 + st->tm_sec ) * 1000 +
tv->tv_usec / 1000.0;
tv.tv_usec / 1000.0;
#else
struct timeb tb;
struct tm * st;

View File

@@ -964,7 +964,7 @@ HB_EXPORT PHB_ITEM hb_itemPutNDDec( PHB_ITEM pItem, double dNumber, int iDec )
HB_EXPORT double hb_itemGetNDDec( PHB_ITEM pItem, int * piDec )
{
HB_TRACE(HB_TR_DEBUG, ("hb_itemGetNDDec(%p,p%)", pItem, piDec));
HB_TRACE(HB_TR_DEBUG, ("hb_itemGetNDDec(%p,%p)", pItem, piDec));
if( HB_IS_INTEGER( pItem ) )
{
@@ -981,11 +981,6 @@ HB_EXPORT double hb_itemGetNDDec( PHB_ITEM pItem, int * piDec )
*piDec = pItem->item.asDouble.decimal;
return pItem->item.asDouble.value;
}
else if( HB_IS_DATE( pItem ) )
{
*piDec = 0;
return ( double ) pItem->item.asDate.value;
}
*piDec = 0;
return 0.0;