From 3850eb6a28f0841658d8d789dddabee55ebbca19 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Tue, 31 Jan 2012 15:22:45 +0000 Subject: [PATCH] 2012-01-31 16:22 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * harbour/src/pp/ppcore.c ! added resetting conditional compilation stack in hb_pp_reset() Before this modification unclosed #if[def] statements were significant for next PRG files passed to Harbour compiler as single command (in such way works also HBMK2 with build in compiler). * clean stream functions and user operators in hb_pp_reset() --- harbour/ChangeLog | 9 +++++++++ harbour/src/pp/ppcore.c | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 7fc57335f7..d0844a83c4 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,15 @@ The license applies to all entries newer than 2009-04-28. */ +2012-01-31 16:22 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * harbour/src/pp/ppcore.c + ! added resetting conditional compilation stack in hb_pp_reset() + Before this modification unclosed #if[def] statements were + significant for next PRG files passed to Harbour compiler + as single command (in such way works also HBMK2 with build + in compiler). + * clean stream functions and user operators in hb_pp_reset() + 2012-01-31 10:43 UTC+0100 Viktor Szakats (harbour syenar.net) * INSTALL * typo and minor tweak to troubleshooting section diff --git a/harbour/src/pp/ppcore.c b/harbour/src/pp/ppcore.c index d5e37b7bdb..7e784b239a 100644 --- a/harbour/src/pp/ppcore.c +++ b/harbour/src/pp/ppcore.c @@ -5531,12 +5531,24 @@ void hb_pp_reset( PHB_PP_STATE pState ) pState->fTracePragmas = HB_FALSE; pState->fQuiet = pState->fQuietSet; pState->iMaxCycles = pState->iMaxCyclesSet; + pState->iCondCompile = 0; + pState->iCondCount = 0; pState->iStreamDump = HB_PP_STREAM_OFF; + hb_pp_tokenListFree( &pState->pFuncOut ); + hb_pp_tokenListFree( &pState->pFuncEnd ); + hb_pp_InFileFree( pState ); hb_pp_OutFileFree( pState ); hb_pp_TraceFileFree( pState ); + if( pState->iOperators > 0 ) + { + hb_pp_operatorsFree( pState->pOperators, pState->iOperators ); + pState->pOperators = NULL; + pState->iOperators = 0; + } + hb_pp_ruleListNonStdFree( &pState->pDefinitions ); hb_pp_ruleListNonStdFree( &pState->pTranslations ); hb_pp_ruleListNonStdFree( &pState->pCommands );