2007-05-22 12:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/bin/hb-func.sh
    +  added -lpcreposix to system libraries when C_USR has -DHB_PCRE_REGEX
  * harbour/include/hbregex.h
    * removed pcre/ path from PCRE header files - if you want to build
      Harbour with PCRE regex and PCRE header files are not in default\
      path then set valid path in C_USR, f.e.:
         export C_USR="${C_USR} -DHB_PCRE_REGEX -I/usr/include/pcre"

  * harbour/include/hbxvm.h
  * harbour/source/compiler/gencc.c
  * harbour/source/vm/hvm.c
    * minor optimizatin for -gc3 output
This commit is contained in:
Przemyslaw Czerpak
2007-05-22 10:23:15 +00:00
parent 75bd21860c
commit 0ae81e63e3
6 changed files with 97 additions and 8 deletions

View File

@@ -8,6 +8,20 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-05-22 12:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/bin/hb-func.sh
+ added -lpcreposix to system libraries when C_USR has -DHB_PCRE_REGEX
* harbour/include/hbregex.h
* removed pcre/ path from PCRE header files - if you want to build
Harbour with PCRE regex and PCRE header files are not in default\
path then set valid path in C_USR, f.e.:
export C_USR="${C_USR} -DHB_PCRE_REGEX -I/usr/include/pcre"
* harbour/include/hbxvm.h
* harbour/source/compiler/gencc.c
* harbour/source/vm/hvm.c
* minor optimizatin for -gc3 output
2007-05-22 01:45 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
* harbour/include/hbapicls.h

View File

@@ -118,6 +118,9 @@ mk_hbtools()
HB_SYS_LIBS="-lm"
HB_CRS_LIB=""
HB_SLN_LIB=""
if [ "${C_USR//-DHB_PCRE_REGEX/}" != "${C_USR}" ]; then
HB_SYS_LIBS="-lpcreposix -lpcre ${HB_SYS_LIBS}"
fi
if [ "${HB_COMPILER}" = "mingw32" ]; then
HB_SYS_LIBS="${HB_SYS_LIBS} -luser32 -lwinspool -lgdi32 -lcomctl32 -lcomdlg32 -lole32 -loleaut32 -luuid -lwsock32 -lws2_32"
elif [ "${HB_COMPILER}" = "djgpp" ]; then

View File

@@ -74,8 +74,8 @@
# define HB_PCRE_REGEX
# endif
#elif defined( HB_PCRE_REGEX )
# include <pcre/pcre.h>
# include <pcre/pcreposix.h>
# include <pcre.h>
# include <pcreposix.h>
#elif defined( HB_POSIX_REGEX )
# include <regex.h>
#else

View File

@@ -252,6 +252,10 @@ extern HB_EXPORT BOOL hb_xvmLocalAdd( int iLocal );
extern HB_EXPORT BOOL hb_xvmStaticAdd( USHORT uiStatic );
extern HB_EXPORT BOOL hb_xvmMemvarAdd( PHB_SYMB pSymbol );
extern HB_EXPORT PHB_ITEM hb_xvmStaticPtr( int iStatic );
extern HB_EXPORT PHB_ITEM hb_xvmLocalPtr( int iLocal );
extern HB_EXPORT void hb_xvmCopyLocals( int iDest, int iSource );
HB_EXTERN_END
#endif /* HB_XVM_H_ */

View File

@@ -1128,18 +1128,50 @@ static HB_GENC_FUNC( hb_p_pushlocal )
{
HB_GENC_LABEL();
fprintf( cargo->yyc, "\thb_xvmPushLocal( %d );\n",
HB_PCODE_MKSHORT( &pFunc->pCode[ lPCodePos + 1 ] ) );
return 3;
switch( pFunc->pCode[ lPCodePos + 3 ] )
{
case HB_P_POPLOCALNEAR:
fprintf( cargo->yyc, "\thb_xvmCopyLocals( %d, %d );\n",
HB_PCODE_MKSHORT( &pFunc->pCode[ lPCodePos + 1 ] ),
( signed char ) pFunc->pCode[ lPCodePos + 4 ] );
return 5;
case HB_P_POPLOCAL:
fprintf( cargo->yyc, "\thb_xvmCopyLocals( %d, %d );\n",
HB_PCODE_MKSHORT( &pFunc->pCode[ lPCodePos + 1 ] ),
HB_PCODE_MKSHORT( &pFunc->pCode[ lPCodePos + 4 ] ) );
return 6;
default:
fprintf( cargo->yyc, "\thb_xvmPushLocal( %d );\n",
HB_PCODE_MKSHORT( &pFunc->pCode[ lPCodePos + 1 ] ) );
return 3;
}
}
static HB_GENC_FUNC( hb_p_pushlocalnear )
{
HB_GENC_LABEL();
fprintf( cargo->yyc, "\thb_xvmPushLocal( %d );\n",
( signed char ) pFunc->pCode[ lPCodePos + 1 ] );
return 2;
switch( pFunc->pCode[ lPCodePos + 2 ] )
{
case HB_P_POPLOCALNEAR:
fprintf( cargo->yyc, "\thb_xvmCopyLocals( %d, %d );\n",
( signed char ) pFunc->pCode[ lPCodePos + 1 ],
( signed char ) pFunc->pCode[ lPCodePos + 3 ] );
return 4;
case HB_P_POPLOCAL:
fprintf( cargo->yyc, "\thb_xvmCopyLocals( %d, %d );\n",
( signed char ) pFunc->pCode[ lPCodePos + 1 ],
HB_PCODE_MKSHORT( &pFunc->pCode[ lPCodePos + 3 ] ) );
return 5;
default:
fprintf( cargo->yyc, "\thb_xvmPushLocal( %d );\n",
( signed char ) pFunc->pCode[ lPCodePos + 1 ] );
return 2;
}
}
static HB_GENC_FUNC( hb_p_pushlocalref )

View File

@@ -7145,6 +7145,42 @@ HB_EXPORT void hb_xvmPopLocal( SHORT iLocal )
hb_vmPopLocal( iLocal );
}
HB_EXPORT PHB_ITEM hb_xvmLocalPtr( int iLocal )
{
HB_TRACE(HB_TR_DEBUG, ("hb_xvmLocalPtr(%d)", iLocal));
if( iLocal >= 0 )
{
/* local variable or local parameter */
return hb_stackLocalVariable( &iLocal );
}
else
{
/* local variable referenced in a codeblock
* hb_stackSelfItem() points to a codeblock that is currently evaluated
*/
return hb_codeblockGetRef( hb_stackSelfItem()->item.asBlock.value, ( LONG ) iLocal );
}
}
HB_EXPORT PHB_ITEM hb_xvmStaticPtr( int iStatic )
{
HB_TRACE(HB_TR_DEBUG, ("hb_xvmStaticPtr(%d)", iStatic));
return s_aStatics.item.asArray.value->pItems + hb_stackGetStaticsBase() + iStatic - 1;
}
HB_EXPORT void hb_xvmCopyLocals( int iDest, int iSource )
{
PHB_ITEM pDest;
HB_TRACE(HB_TR_DEBUG, ("hb_xvmCopyLocals(%d,%d)", iDest, iSource));
pDest = hb_xvmLocalPtr( iDest );
hb_itemCopyToRef( hb_xvmLocalPtr( iSource ),
HB_IS_BYREF( pDest ) ? hb_itemUnRef( pDest ) : pDest );
}
HB_EXPORT void hb_xvmPushStatic( USHORT uiStatic )
{
HB_TRACE(HB_TR_DEBUG, ("hb_xvmPushStatic(%hu)", uiStatic));