diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 00c6c3c2f5..97441fb75f 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,14 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ + * harbour/include/hbvm.h + * harbour/source/vm/hvm.c + * harbour/source/vm/itemapi.c + + added __enumStop() message for "FOR EACH" overloading + It's guarantied that it will be sent to base item if it is an + object with such message when FOR EACH ... NEXT will finish its job + even if it will be interrupted by EXIT or RETURN to allow base object + clear resources allocated for FOR EACH enumerator. The BREAK exception is not supported now. This is sth what I'd like to discuss soon when I'll add destructors. Please think now if we should allow to execute destructors and other cleanup user code when we are returning to diff --git a/harbour/source/compiler/genc.c b/harbour/source/compiler/genc.c index b64fc8fb8d..b89f18dc30 100644 --- a/harbour/source/compiler/genc.c +++ b/harbour/source/compiler/genc.c @@ -95,9 +95,6 @@ void hb_compGenCCode( PHB_FNAME pFileName ) /* generates the C language ou hb_xfree( szHrb ); } - if( ! hb_comp_bStartProc ) - hb_comp_iFunctionCnt--; - if( hb_comp_iFunctionCnt ) { fprintf( yyc, "#include \"hbvmpub.h\"\n" ); @@ -304,13 +301,16 @@ void hb_compGenCCode( PHB_FNAME pFileName ) /* generates the C language ou pInline = hb_comp_inlines.pFirst; while( pInline ) { - fprintf( yyc, "#line %i \"%s\"\n", pInline->iLine, pInline->szFileName ); - - if( pInline->szName ) + if( pInline->pCode ) { - fprintf( yyc, "HB_FUNC_STATIC( %s )\n", pInline->szName ); + fprintf( yyc, "#line %i \"%s\"\n", pInline->iLine, pInline->szFileName ); + + if( pInline->szName ) + { + fprintf( yyc, "HB_FUNC_STATIC( %s )\n", pInline->szName ); + } + fprintf( yyc, "%s", pInline->pCode ); } - fprintf( yyc, "%s", pInline->pCode ); pInline = pInline->pNext; } } diff --git a/harbour/source/compiler/gencli.c b/harbour/source/compiler/gencli.c index 670a0ae469..8b610e1594 100644 --- a/harbour/source/compiler/gencli.c +++ b/harbour/source/compiler/gencli.c @@ -96,8 +96,6 @@ void hb_compGenILCode( PHB_FNAME pFileName ) /* generates the IL output */ HB_VER_MINOR, HB_VER_REVISION, HB_VER_LEX ); fprintf( yyc, "// Generated .NET IL source code\n\n" ); - if( ! hb_comp_bStartProc ) - hb_comp_iFunctionCnt--; if( hb_comp_iFunctionCnt ) { fprintf( yyc, ".assembly extern mscorlib{}\n" ); diff --git a/harbour/source/compiler/harbour.c b/harbour/source/compiler/harbour.c index fd4e0001db..b4a281ed34 100644 --- a/harbour/source/compiler/harbour.c +++ b/harbour/source/compiler/harbour.c @@ -4803,6 +4803,7 @@ int hb_compCompile( char * szPrg, int argc, char * argv[], BOOL bSingleFile ) /* skip first non-startup procedure */ hb_compOptimizeFrames( *pFunPtr ); pFunPtr = &(*pFunPtr)->pNext; + hb_comp_iFunctionCnt--; } while( *pFunPtr )