2007-08-28 03:15 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/source/rtl/diskspac.c
  * harbour/source/rtl/disksphb.c
    ! casting for C++ compilers

  * harbour/source/rtl/hbinet.c
    * added hack for unimplemented in Linux OpenWatcom version
      h_errno and hstrerror()

  * harbour/source/rtl/hbregex.c
  * harbour/source/hbpcre/pcreglob.c
  * harbour/contrib/btree/hb_btree.c
    * workaround for C/C++ compilers which may use different calling
      convention for standard C functions
This commit is contained in:
Przemyslaw Czerpak
2007-08-28 01:15:31 +00:00
parent 1173c6761d
commit 8eebea16f5
7 changed files with 45 additions and 16 deletions

View File

@@ -8,6 +8,21 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-08-28 03:15 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/rtl/diskspac.c
* harbour/source/rtl/disksphb.c
! casting for C++ compilers
* harbour/source/rtl/hbinet.c
* added hack for unimplemented in Linux OpenWatcom version
h_errno and hstrerror()
* harbour/source/rtl/hbregex.c
* harbour/source/hbpcre/pcreglob.c
* harbour/contrib/btree/hb_btree.c
* workaround for C/C++ compilers which may use different calling
convention for standard C functions
2007-08-27 17:35 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/rtl/diskspac.c
* harbour/source/rtl/disksphb.c

View File

@@ -1556,6 +1556,11 @@ BOOL hb_BTreeSeek( struct hb_BTree * pBTree, BYTE *szKey, LONG lData, BOOL bSoft
}
static int hb_BTstrncmp( const char *s1, const char *s2, size_t n )
{
return strncmp( s1, s2, n );
}
/* allocate hb_BTree structure */
struct hb_BTree * hb_BTreeNew( BYTE * FileName, USHORT usPageSize, USHORT usKeySize, ULONG ulFlags, USHORT usBuffers )
{
@@ -1643,7 +1648,7 @@ struct hb_BTree * hb_BTreeNew( BYTE * FileName, USHORT usPageSize, USHORT usKeyS
}
else
{
pBTree->pStrCompare = ( BTreeCmpFunc ) strncmp;
pBTree->pStrCompare = ( BTreeCmpFunc ) hb_BTstrncmp;
}
if ( GETFLAG( pBTree, IsInMemory ) == FALSE )
@@ -1729,7 +1734,7 @@ struct hb_BTree *hb_BTreeOpen( BYTE *FileName, ULONG ulFlags, USHORT usBuffers )
}
else
{
pBTree->pStrCompare = ( BTreeCmpFunc ) strncmp;
pBTree->pStrCompare = ( BTreeCmpFunc ) hb_BTstrncmp;
}
return pBTree;

View File

@@ -47,24 +47,29 @@ all threads. However, when compiling for Virtual Pascal, things are done
differently, and global variables are not used (see pcre.in). */
#include "hbapi.h"
#include "pcreinal.h"
static void * hb_pcre_grab( size_t size )
{
return hb_xgrab( size );
}
#ifndef VPCOMPAT
#ifdef __cplusplus
extern "C"
{
void *(*pcre_malloc)(size_t) = malloc;
void (*pcre_free)(void *) = free;
void *(*pcre_stack_malloc)(size_t) = malloc;
void (*pcre_stack_free)(void *) = free;
void *(*pcre_malloc)(size_t) = hb_pcre_grab;
void (*pcre_free)(void *) = hb_xfree;
void *(*pcre_stack_malloc)(size_t) = hb_pcre_grab;
void (*pcre_stack_free)(void *) = hb_xfree;
int (*pcre_callout)(pcre_callout_block *) = NULL;
}
#else
void *(*pcre_malloc)(size_t) = malloc;
void (*pcre_free)(void *) = free;
void *(*pcre_stack_malloc)(size_t) = malloc;
void (*pcre_stack_free)(void *) = free;
void *(*pcre_malloc)(size_t) = hb_pcre_grab;
void (*pcre_free)(void *) = hb_xfree;
void *(*pcre_stack_malloc)(size_t) = hb_pcre_grab;
void (*pcre_stack_free)(void *) = hb_xfree;
int (*pcre_callout)(pcre_callout_block *) = NULL;
#endif
#endif

View File

@@ -215,7 +215,7 @@ HB_FUNC( DISKSPACE )
if( !szName )
szName = ( char * ) "/";
szName = hb_fileNameConv( hb_strdup( szName ) );
szName = ( char * ) hb_fileNameConv( hb_strdup( szName ) );
if( statvfs( szName, &st ) == 0 )
{

View File

@@ -329,7 +329,7 @@ HB_FUNC( HB_DISKSPACE )
{
struct statvfs sf;
szPath = hb_fileNameConv( hb_strdup( szPath ) );
szPath = ( char * ) hb_fileNameConv( hb_strdup( szPath ) );
if( statvfs( szPath, &sf ) == 0 )
{
switch( uiType )

View File

@@ -78,8 +78,6 @@
#include <windows.h>
#define HB_INET_CLOSE( x ) closesocket( x )
extern char *hstrerror( int i );
#else
#if defined( HB_OS_HPUX )
@@ -94,7 +92,11 @@
#include <netinet/in.h>
#include <arpa/inet.h>
extern int h_errno;
#if defined(__WATCOMC__)
#define h_errno errno
#else
extern int h_errno;
#endif
#define HB_INET_CLOSE( x ) close( x )
#include <errno.h>
#endif
@@ -333,7 +335,7 @@ static struct hostent * hb_getHosts( char * name, HB_SOCKET_STRUCT *Socket )
#if defined(HB_OS_WIN_32)
HB_SOCKET_SET_ERROR2( Socket, WSAGetLastError() , "Generic error in GetHostByName()" );
WSASetLastError( 0 );
#elif defined(HB_OS_OS2) || defined(HB_OS_HPUX)
#elif defined(HB_OS_OS2) || defined(HB_OS_HPUX) || defined(__WATCOMC__)
HB_SOCKET_SET_ERROR2( Socket, h_errno, "Generic error in GetHostByName()" );
#else
HB_SOCKET_SET_ERROR2( Socket, h_errno, (char *) hstrerror( h_errno ) );

View File

@@ -545,6 +545,8 @@ HB_CALL_ON_STARTUP_BEGIN( _hb_regex_init_ )
#if defined( HB_PCRE_REGEX )
pcre_malloc = hb_pcre_grab;
pcre_free = hb_xfree;
pcre_stack_malloc = hb_pcre_grab;
pcre_stack_free = hb_xfree;
#endif
hb_regexInit( hb_regfree, hb_regcomp, hb_regexec );
HB_CALL_ON_STARTUP_END( _hb_regex_init_ )