2011-04-19 15:11 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/vm/procaddr.c
! removed dummy entry at the end of function table
* harbour/src/common/hbstr.c
* harbour/src/rdd/dbfcdx/dbfcdx1.c
* harbour/src/rdd/hsx/hsx.c
* harbour/contrib/xhb/fparse.c
* pacified warnings
* harbour/include/hbsetup.h
* disabled flatten function attribute in ANDROID builds,
it causes that Android_NDK-GCC GPFs compiling src/vm/procaddr.c
* harbour/include/hbdate.h
* enabled localtime_r() in Android builds
* harbour/src/common/hbgete.c
* enabled setenv() in Android builds
* harbour/src/common/hbtrace.c
! fixed ANDROID_LOG_* flags
; QUESTION: why Android log is used instead of syslog?
It causes that harbour has to be linked with
log library (-llog).
* harbour/src/common/hbprintf.c
* disabled modfl() in Android builds
* harbour/src/rtl/filesys.c
* added hack for missing functions in android libc library
* harbour/src/rtl/diskspac.c
* harbour/src/rtl/disksphb.c
* use statfs instead of statvfs in Android builds
* harbour/contrib/hbct/dattime3.c
* disabled stime() in Android builds
* harbour/contrib/hbmzip/3rd/minizip/ioapi.h
* do not use 64bit FILE functions in Android builds
* harbour/contrib/xhb/hbsyslog.c
* disabled using Android log in Android builds - use standard syslog
instead. This code needs deeper modification to switch to Android log.
; I have just recompiled whole Harbour code for android-3, android-5
and android-9 at ARM using standard Harbour Linux build files.
Android does not have pthread and rt libraries (they are merged
with android c library) so to avoid link errors I simply created
soft links from libpthread.a and librt.a to libc.a.
With this hack could use unmodified hbmk2 and linux .mk files.
BTW exporting HB_CPU="arm" was not enough to switch to cross build
in my x86@64 Linux machine so I had to export HB_HOST_BIN and set
HB_BUILD_3RDEXT="no"
This commit is contained in:
@@ -16,6 +16,62 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2011-04-19 15:11 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/src/vm/procaddr.c
|
||||
! removed dummy entry at the end of function table
|
||||
|
||||
* harbour/src/common/hbstr.c
|
||||
* harbour/src/rdd/dbfcdx/dbfcdx1.c
|
||||
* harbour/src/rdd/hsx/hsx.c
|
||||
* harbour/contrib/xhb/fparse.c
|
||||
* pacified warnings
|
||||
|
||||
* harbour/include/hbsetup.h
|
||||
* disabled flatten function attribute in ANDROID builds,
|
||||
it causes that Android_NDK-GCC GPFs compiling src/vm/procaddr.c
|
||||
|
||||
* harbour/include/hbdate.h
|
||||
* enabled localtime_r() in Android builds
|
||||
|
||||
* harbour/src/common/hbgete.c
|
||||
* enabled setenv() in Android builds
|
||||
|
||||
* harbour/src/common/hbtrace.c
|
||||
! fixed ANDROID_LOG_* flags
|
||||
; QUESTION: why Android log is used instead of syslog?
|
||||
It causes that harbour has to be linked with
|
||||
log library (-llog).
|
||||
|
||||
* harbour/src/common/hbprintf.c
|
||||
* disabled modfl() in Android builds
|
||||
|
||||
* harbour/src/rtl/filesys.c
|
||||
* added hack for missing functions in android libc library
|
||||
|
||||
* harbour/src/rtl/diskspac.c
|
||||
* harbour/src/rtl/disksphb.c
|
||||
* use statfs instead of statvfs in Android builds
|
||||
|
||||
* harbour/contrib/hbct/dattime3.c
|
||||
* disabled stime() in Android builds
|
||||
|
||||
* harbour/contrib/hbmzip/3rd/minizip/ioapi.h
|
||||
* do not use 64bit FILE functions in Android builds
|
||||
|
||||
* harbour/contrib/xhb/hbsyslog.c
|
||||
* disabled using Android log in Android builds - use standard syslog
|
||||
instead. This code needs deeper modification to switch to Android log.
|
||||
|
||||
; I have just recompiled whole Harbour code for android-3, android-5
|
||||
and android-9 at ARM using standard Harbour Linux build files.
|
||||
Android does not have pthread and rt libraries (they are merged
|
||||
with android c library) so to avoid link errors I simply created
|
||||
soft links from libpthread.a and librt.a to libc.a.
|
||||
With this hack could use unmodified hbmk2 and linux .mk files.
|
||||
BTW exporting HB_CPU="arm" was not enough to switch to cross build
|
||||
in my x86@64 Linux machine so I had to export HB_HOST_BIN and set
|
||||
HB_BUILD_3RDEXT="no"
|
||||
|
||||
2011-04-19 13:54 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* ChangeLog
|
||||
* Corrected some old text.
|
||||
|
||||
@@ -135,7 +135,7 @@ HB_FUNC( SETTIME )
|
||||
st.wSecond = ( WORD ) iTime[2];
|
||||
st.wMilliseconds = ( WORD ) iTime[3] * 10;
|
||||
fResult = SetLocalTime( &st );
|
||||
#elif defined( HB_OS_LINUX ) && !defined( __WATCOMC__ )
|
||||
#elif defined( HB_OS_LINUX ) && !defined( HB_OS_ANDROID ) && !defined( __WATCOMC__ )
|
||||
/* stime exists only in SVr4, SVID, X/OPEN and Linux */
|
||||
HB_ULONG lNewTime;
|
||||
time_t tm;
|
||||
@@ -170,7 +170,7 @@ HB_FUNC( SETDATE )
|
||||
st.wDay = ( WORD ) iDay;
|
||||
st.wDayOfWeek = ( WORD ) hb_dateJulianDOW( lDate );
|
||||
fResult = SetLocalTime( &st );
|
||||
#elif defined( HB_OS_LINUX ) && !defined( __WATCOMC__ )
|
||||
#elif defined( HB_OS_LINUX ) && !defined( HB_OS_ANDROID ) && !defined( __WATCOMC__ )
|
||||
/* stime exists only in SVr4, SVID, X/OPEN and Linux */
|
||||
long lNewDate;
|
||||
time_t tm;
|
||||
|
||||
@@ -68,7 +68,8 @@
|
||||
defined( HB_OS_DOS ) || \
|
||||
defined( HB_OS_OS2 ) || \
|
||||
defined( HB_OS_CYGWIN ) || \
|
||||
defined( HB_OS_MINIX )
|
||||
defined( HB_OS_MINIX ) || \
|
||||
defined( HB_OS_ANDROID )
|
||||
# define USE_FILE32API
|
||||
#endif
|
||||
|
||||
|
||||
@@ -672,7 +672,7 @@ HB_FUNC( FPARSELINE )
|
||||
if( szText )
|
||||
{
|
||||
const char * szDelim = hb_parc( 2 );
|
||||
int iWords;
|
||||
int iWords = 0;
|
||||
hb_ParseLine( pArray, szText, szDelim ? ( unsigned char ) *szDelim : ',', &iWords );
|
||||
nWords = iWords;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
static HANDLE s_RegHandle;
|
||||
|
||||
#elif defined( HB_OS_ANDROID )
|
||||
#elif defined( HB_OS_ANDROID ) && 0
|
||||
|
||||
#include <android/log.h>
|
||||
|
||||
@@ -114,13 +114,13 @@ HB_FUNC( HB_SYSLOGMESSAGE )
|
||||
#endif
|
||||
hb_retl( HB_FALSE );
|
||||
|
||||
#elif defined( HB_OS_ANDROID )
|
||||
#elif defined( HB_OS_ANDROID ) && 0
|
||||
|
||||
int logval;
|
||||
|
||||
switch( hb_parni( 2 ) )
|
||||
{
|
||||
case HB_LOG_CRITICAL: logval = ANDROID_LOG_VERBOSE; break;
|
||||
case HB_LOG_CRITICAL: logval = ANDROID_LOG_FATAL; break;
|
||||
case HB_LOG_ERROR: logval = ANDROID_LOG_ERROR; break;
|
||||
case HB_LOG_WARN: logval = ANDROID_LOG_WARN; break;
|
||||
case HB_LOG_INFO: logval = ANDROID_LOG_INFO; break;
|
||||
|
||||
@@ -153,7 +153,8 @@ HB_EXTERN_END
|
||||
|
||||
#if ( defined( _POSIX_C_SOURCE ) || defined( _XOPEN_SOURCE ) || \
|
||||
defined( _BSD_SOURCE ) || defined( _SVID_SOURCE ) || \
|
||||
defined( HB_OS_SUNOS ) || defined( HB_OS_BEOS ) ) && \
|
||||
defined( HB_OS_SUNOS ) || defined( HB_OS_BEOS ) || \
|
||||
defined( HB_OS_ANDROID ) ) && \
|
||||
! defined( HB_OS_DARWIN_5 ) && !defined( HB_HAS_LOCALTIME_R )
|
||||
# define HB_HAS_LOCALTIME_R
|
||||
#endif
|
||||
|
||||
@@ -540,6 +540,7 @@
|
||||
# if ( ( __GNUC__ > 4 ) || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 1 ) ) && \
|
||||
!defined( __ICC ) && !defined( __clang__ ) && \
|
||||
!defined( __PCC__ ) && \
|
||||
!defined( HB_OS_ANDROID ) && \
|
||||
!defined( HB_NO_FLATTEN )
|
||||
#define HB_FLATTEN_ATTR \
|
||||
__attribute__ (( flatten ))
|
||||
|
||||
@@ -217,7 +217,8 @@ HB_BOOL hb_setenv( const char * szName, const char * szValue )
|
||||
defined( HB_OS_SUNOS ) || defined( HB_OS_BSD ) || \
|
||||
defined( HB_OS_DARWIN ) || defined( HB_OS_BEOS ) || \
|
||||
defined( HB_OS_QNX ) || defined( HB_OS_VXWORKS ) || \
|
||||
defined( HB_OS_CYGWIN ) || defined( HB_OS_MINIX )
|
||||
defined( HB_OS_CYGWIN ) || defined( HB_OS_MINIX ) || \
|
||||
defined( HB_OS_ANDROID )
|
||||
|
||||
if( szValue )
|
||||
return setenv( szName, szValue, 1 ) == 0;
|
||||
|
||||
@@ -166,6 +166,7 @@ optimized.
|
||||
# if defined( __WATCOMC__ ) || defined( __MINGW32CE__ ) || defined( HB_OS_CYGWIN ) || \
|
||||
defined( HB_OS_BEOS ) || defined( HB_OS_IPHONE ) || defined( HB_OS_SYMBIAN ) || \
|
||||
defined( __OpenBSD__ ) || defined( __NetBSD__ ) || defined( __DragonFly__ ) || \
|
||||
defined( HB_OS_ANDROID ) || \
|
||||
( defined( HB_OS_WIN_CE ) && defined( __POCC__ ) ) || defined( HB_OS_MINIX )
|
||||
# define _HB_WRAP_MODFL_
|
||||
# define _MODFD( x, p ) _hb_modfl( x, p )
|
||||
|
||||
@@ -576,6 +576,7 @@ static HB_BOOL hb_str2number( HB_BOOL fPCode, const char * szNum, HB_SIZE nLen,
|
||||
iPos++;
|
||||
}
|
||||
|
||||
*dVal = 0;
|
||||
*lVal = 0;
|
||||
|
||||
/* Hex Number */
|
||||
|
||||
@@ -306,9 +306,9 @@ static void hb_tracelog_( int level, const char * file, int line, const char * p
|
||||
|
||||
switch( level )
|
||||
{
|
||||
case HB_TR_ALWAYS: slevel = ANDROID_LOG_ASSERT; break;
|
||||
case HB_TR_FATAL: slevel = ANDROID_LOG_VERBOSE; break;
|
||||
case HB_TR_ERROR: slevel = ANDROID_LOG_ERROR break;
|
||||
case HB_TR_ALWAYS: slevel = ANDROID_LOG_VERBOSE; break;
|
||||
case HB_TR_FATAL: slevel = ANDROID_LOG_FATAL; break;
|
||||
case HB_TR_ERROR: slevel = ANDROID_LOG_ERROR; break;
|
||||
case HB_TR_WARNING: slevel = ANDROID_LOG_WARN; break;
|
||||
case HB_TR_INFO: slevel = ANDROID_LOG_INFO; break;
|
||||
case HB_TR_DEBUG: slevel = ANDROID_LOG_DEBUG; break;
|
||||
|
||||
@@ -9123,6 +9123,8 @@ static HB_BOOL hb_cdxSortKeyGet( LPCDXSORTINFO pSort, HB_BYTE ** pKeyVal, HB_ULO
|
||||
pSort->pSwapPage[ ulPage ].ulKeyBuf--;
|
||||
return HB_TRUE;
|
||||
}
|
||||
*pulRec = 0;
|
||||
*pKeyVal = NULL;
|
||||
return HB_FALSE;
|
||||
}
|
||||
|
||||
@@ -9168,6 +9170,8 @@ static HB_BOOL hb_cdxSortKeyGet( LPCDXSORTINFO pSort, HB_BYTE ** pKeyVal, HB_ULO
|
||||
*pKeyVal = pKey;
|
||||
return HB_TRUE;
|
||||
}
|
||||
*pulRec = 0;
|
||||
*pKeyVal = NULL;
|
||||
return HB_FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -1107,6 +1107,9 @@ static int hb_hsxAdd( int iHandle, HB_ULONG *pulRecNo, PHB_ITEM pExpr, HB_BOOL f
|
||||
LPHSXINFO pHSX = hb_hsxGetPointer( iHandle );
|
||||
int iRetVal, iRet;
|
||||
|
||||
if( pulRecNo )
|
||||
*pulRecNo = 0;
|
||||
|
||||
if( ! pHSX )
|
||||
return HSX_BADHANDLE;
|
||||
|
||||
|
||||
@@ -64,24 +64,25 @@
|
||||
# if defined( __WATCOMC__ ) || defined( __CEGCC__ ) || \
|
||||
defined( HB_OS_VXWORKS ) || defined( HB_OS_SYMBIAN )
|
||||
# include <sys/stat.h>
|
||||
# elif defined( HB_OS_ANDROID )
|
||||
# include <sys/statfs.h>
|
||||
# elif defined( HB_OS_DARWIN )
|
||||
# include <sys/param.h>
|
||||
# include <sys/mount.h>
|
||||
# else
|
||||
# include <sys/statvfs.h>
|
||||
# endif
|
||||
#endif
|
||||
#if defined( HB_OS_WIN )
|
||||
#include <windows.h>
|
||||
#if defined( HB_OS_WIN_CE )
|
||||
#include "hbwince.h"
|
||||
#endif
|
||||
#elif defined( HB_OS_WIN )
|
||||
# include <windows.h>
|
||||
# if defined( HB_OS_WIN_CE )
|
||||
# include "hbwince.h"
|
||||
# endif
|
||||
#elif defined( HB_OS_OS2 )
|
||||
#define INCL_BASE
|
||||
#define INCL_DOSERRORS
|
||||
#include <os2.h>
|
||||
# define INCL_BASE
|
||||
# define INCL_DOSERRORS
|
||||
# include <os2.h>
|
||||
#elif defined( HB_OS_DOS )
|
||||
#include <dos.h>
|
||||
# include <dos.h>
|
||||
#endif
|
||||
|
||||
HB_FUNC( DISKSPACE )
|
||||
@@ -237,7 +238,8 @@ HB_FUNC( DISKSPACE )
|
||||
|
||||
bError = HB_FALSE;
|
||||
#else
|
||||
#if defined( HB_OS_DARWIN ) || defined( HB_OS_VXWORKS )
|
||||
#if defined( HB_OS_DARWIN ) || defined( HB_OS_ANDROID ) || \
|
||||
defined( HB_OS_VXWORKS )
|
||||
struct statfs st;
|
||||
bError = statfs( szName, &st ) != 0;
|
||||
#else
|
||||
|
||||
@@ -57,14 +57,15 @@
|
||||
#if defined( HB_OS_DARWIN )
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
#elif defined( HB_OS_ANDROID )
|
||||
#include <sys/statfs.h>
|
||||
#elif defined( HB_OS_UNIX ) && !( defined( __WATCOMC__ ) || defined( __CEGCC__ ) )
|
||||
#if defined( HB_OS_VXWORKS ) || defined( HB_OS_SYMBIAN )
|
||||
#include <sys/stat.h>
|
||||
#else
|
||||
#include <sys/statvfs.h>
|
||||
#endif
|
||||
#endif
|
||||
#if defined( HB_OS_WIN )
|
||||
#elif defined( HB_OS_WIN )
|
||||
#include <windows.h>
|
||||
#if defined( HB_OS_WIN_CE )
|
||||
#include "hbwince.h"
|
||||
@@ -359,7 +360,8 @@ HB_FUNC( HB_DISKSPACE )
|
||||
}
|
||||
#elif defined( HB_OS_UNIX ) && !( defined( __WATCOMC__ ) || defined( __CEGCC__ ) || defined( HB_OS_SYMBIAN ) )
|
||||
{
|
||||
#if defined( HB_OS_DARWIN ) || defined( HB_OS_VXWORKS )
|
||||
#if defined( HB_OS_DARWIN ) || defined( HB_OS_ANDROID ) || \
|
||||
defined( HB_OS_VXWORKS )
|
||||
struct statfs sf;
|
||||
#else
|
||||
struct statvfs sf;
|
||||
@@ -368,7 +370,8 @@ HB_FUNC( HB_DISKSPACE )
|
||||
|
||||
szPath = hb_fsNameConv( szPath, &pszFree );
|
||||
|
||||
#if defined( HB_OS_DARWIN ) || defined( HB_OS_VXWORKS )
|
||||
#if defined( HB_OS_DARWIN ) || defined( HB_OS_ANDROID ) || \
|
||||
defined( HB_OS_VXWORKS )
|
||||
if( statfs( szPath, &sf ) == 0 )
|
||||
#else
|
||||
if( statvfs( szPath, &sf ) == 0 )
|
||||
|
||||
@@ -308,6 +308,14 @@
|
||||
#define HB_FS_SOPEN
|
||||
#endif
|
||||
|
||||
#if defined( HB_OS_ANDROID )
|
||||
/* hack for missing functions in android libc library */
|
||||
#define fdatasync fsync
|
||||
#define ftruncate64 ftruncate
|
||||
#define pread64 pread
|
||||
#define pwrite64(f,b,s,o) pwrite(f,(void*)b,s,o)
|
||||
#endif
|
||||
|
||||
#if UINT_MAX == USHRT_MAX
|
||||
#define HB_FS_IO_16BIT
|
||||
#endif
|
||||
|
||||
@@ -117,7 +117,7 @@ PHB_FUNC hb_vmProcAddress( const char * szFuncName )
|
||||
{ "hb_xalloc", ( PHB_FUNC ) hb_xalloc },
|
||||
{ "hb_xfree", ( PHB_FUNC ) hb_xfree },
|
||||
{ "hb_xgrab", ( PHB_FUNC ) hb_xgrab },
|
||||
{ "hb_xrealloc", ( PHB_FUNC ) hb_xrealloc },
|
||||
{ "hb_xrealloc", ( PHB_FUNC ) hb_xrealloc }
|
||||
};
|
||||
|
||||
unsigned int uiFirst = 0, uiLast = HB_SIZEOFARRAY( s_funcTable ), uiMiddle;
|
||||
|
||||
Reference in New Issue
Block a user