2007-03-13 23:35 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/pp/pplib.c
! fixed std rules initialization - now it should also use GC pointer
item or __PP_STDRULES will ignore it
This commit is contained in:
@@ -8,6 +8,11 @@
|
||||
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
|
||||
*/
|
||||
|
||||
2007-03-13 23:35 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/source/pp/pplib.c
|
||||
! fixed std rules initialization - now it should also use GC pointer
|
||||
item or __PP_STDRULES will ignore it
|
||||
|
||||
2007-03-13 19:40 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/include/hbapi.h
|
||||
* harbour/include/hbapiitm.h
|
||||
|
||||
@@ -99,7 +99,7 @@ static HB_GARBAGE_FUNC( hb_pp_Destructor )
|
||||
}
|
||||
}
|
||||
|
||||
static void hb_pp_StdRules( PHB_PP_STATE pState )
|
||||
static void hb_pp_StdRules( PHB_ITEM ppItem )
|
||||
{
|
||||
static BOOL s_fInit = TRUE;
|
||||
static PHB_DYNS s_pDynSym;
|
||||
@@ -114,7 +114,7 @@ static void hb_pp_StdRules( PHB_PP_STATE pState )
|
||||
{
|
||||
hb_vmPushDynSym( s_pDynSym );
|
||||
hb_vmPushNil();
|
||||
hb_vmPushPointer( ( void * ) &pState );
|
||||
hb_vmPush( ppItem );
|
||||
hb_vmDo( 1 );
|
||||
}
|
||||
}
|
||||
@@ -143,6 +143,12 @@ HB_FUNC( __PP_INIT )
|
||||
if( pState )
|
||||
{
|
||||
char * szPath = hb_parc( 1 ), * szStdCh = hb_parc( 2 );
|
||||
PHB_ITEM ppItem;
|
||||
|
||||
pStatePtr = ( PHB_PP_STATE * ) hb_gcAlloc( sizeof( PHB_PP_STATE ),
|
||||
hb_pp_Destructor );
|
||||
* pStatePtr = pState;
|
||||
ppItem = hb_itemPutPtrGC( NULL, ( void * ) pStatePtr );
|
||||
|
||||
hb_pp_init( pState, TRUE, 0, NULL, NULL, NULL,
|
||||
hb_pp_ErrorMessage, hb_pp_Disp, NULL, NULL, NULL );
|
||||
@@ -150,18 +156,15 @@ HB_FUNC( __PP_INIT )
|
||||
if( szPath )
|
||||
hb_pp_addSearchPath( pState, szPath, TRUE );
|
||||
|
||||
if( szStdCh )
|
||||
if( !szStdCh )
|
||||
hb_pp_StdRules( ppItem );
|
||||
else if( *szStdCh )
|
||||
hb_pp_readRules( pState, szStdCh );
|
||||
else
|
||||
hb_pp_StdRules( pState );
|
||||
|
||||
hb_pp_initDynDefines( pState );
|
||||
hb_pp_setStdBase( pState );
|
||||
|
||||
pStatePtr = ( PHB_PP_STATE * ) hb_gcAlloc( sizeof( PHB_PP_STATE ),
|
||||
hb_pp_Destructor );
|
||||
* pStatePtr = pState;
|
||||
hb_retptrGC( pStatePtr );
|
||||
hb_itemRelease( hb_itemReturnForward( ppItem ) );
|
||||
}
|
||||
else
|
||||
hb_ret();
|
||||
|
||||
Reference in New Issue
Block a user