2011-01-27 00:22 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/include/hbcompdf.h
  * harbour/src/compiler/hbmain.c
    * save and restore compiler settings when separated .prg files are
      compiled as different modules. Files compiled as single module
      (i.e. by .clp files, #included, added by DO ... [WITH ...], etc.)
      are still compiled using the same settings inheriting any modifications
      introduced by #pragma. It's intentional behavior.
This commit is contained in:
Przemyslaw Czerpak
2011-01-26 23:22:54 +00:00
parent f3259b2cab
commit 6e1a0844d2
3 changed files with 64 additions and 0 deletions

View File

@@ -16,6 +16,15 @@
The license applies to all entries newer than 2009-04-28.
*/
2011-01-27 00:22 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcompdf.h
* harbour/src/compiler/hbmain.c
* save and restore compiler settings when separated .prg files are
compiled as different modules. Files compiled as single module
(i.e. by .clp files, #included, added by DO ... [WITH ...], etc.)
are still compiled using the same settings inheriting any modifications
introduced by #pragma. It's intentional behavior.
2011-01-26 23:56 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbpp.h
* harbour/src/pp/ppcore.c

View File

@@ -837,6 +837,24 @@ typedef struct _HB_COMP
}
HB_COMP, * HB_COMP_PTR;
typedef struct
{
HB_BOOL fDebugInfo;
HB_BOOL fAutoMemvarAssume;
HB_BOOL fI18n;
HB_BOOL fLineNumbers;
HB_BOOL fPPO;
HB_BOOL fPPT;
HB_BOOL fQuiet;
HB_BOOL fForceMemvars;
int iStartProc;
int iWarnings;
int iExitLevel;
int iHidden;
int supported;
}
HB_COMP_SWITCHES, * PHB_COMP_SWITCHES;
extern HB_COMP_PTR hb_comp_new( void );
extern void hb_comp_free( HB_COMP_PTR );

View File

@@ -4038,9 +4038,44 @@ static void hb_compGenIncluded( HB_COMP_DECL )
}
}
static void hb_compSaveSwitches( HB_COMP_DECL, PHB_COMP_SWITCHES pSwitches )
{
pSwitches->fDebugInfo = HB_COMP_PARAM->fDebugInfo;
pSwitches->fAutoMemvarAssume = HB_COMP_PARAM->fAutoMemvarAssume;
pSwitches->fI18n = HB_COMP_PARAM->fI18n;
pSwitches->fLineNumbers = HB_COMP_PARAM->fLineNumbers;
pSwitches->fPPO = HB_COMP_PARAM->fPPO;
pSwitches->fPPT = HB_COMP_PARAM->fPPT;
pSwitches->fQuiet = HB_COMP_PARAM->fQuiet;
pSwitches->fForceMemvars = HB_COMP_PARAM->fForceMemvars;
pSwitches->iStartProc = HB_COMP_PARAM->iStartProc;
pSwitches->iWarnings = HB_COMP_PARAM->iWarnings;
pSwitches->iExitLevel = HB_COMP_PARAM->iExitLevel;
pSwitches->iHidden = HB_COMP_PARAM->iHidden;
pSwitches->supported = HB_COMP_PARAM->supported;
}
static void hb_compRestoreSwitches( HB_COMP_DECL, PHB_COMP_SWITCHES pSwitches )
{
HB_COMP_PARAM->fDebugInfo = pSwitches->fDebugInfo;
HB_COMP_PARAM->fAutoMemvarAssume = pSwitches->fAutoMemvarAssume;
HB_COMP_PARAM->fI18n = pSwitches->fI18n;
HB_COMP_PARAM->fLineNumbers = pSwitches->fLineNumbers;
HB_COMP_PARAM->fPPO = pSwitches->fPPO;
HB_COMP_PARAM->fPPT = pSwitches->fPPT;
HB_COMP_PARAM->fQuiet = pSwitches->fQuiet;
HB_COMP_PARAM->fForceMemvars = pSwitches->fForceMemvars;
HB_COMP_PARAM->iStartProc = pSwitches->iStartProc;
HB_COMP_PARAM->iWarnings = pSwitches->iWarnings;
HB_COMP_PARAM->iExitLevel = pSwitches->iExitLevel;
HB_COMP_PARAM->iHidden = pSwitches->iHidden;
HB_COMP_PARAM->supported = pSwitches->supported;
}
static int hb_compCompile( HB_COMP_DECL, const char * szPrg, const char * szBuffer )
{
char buffer[ HB_PATH_MAX * 2 + 80 ];
HB_COMP_SWITCHES switches;
int iStatus = EXIT_SUCCESS;
PHB_FNAME pFileName = NULL;
PHB_MODULE pModule;
@@ -4048,6 +4083,7 @@ static int hb_compCompile( HB_COMP_DECL, const char * szPrg, const char * szBuff
HB_TRACE(HB_TR_DEBUG, ("hb_compCompile(%s,%p)", szPrg, szBuffer));
hb_compSaveSwitches( HB_COMP_PARAM, &switches );
/* Initialize support variables */
hb_compInitVars( HB_COMP_PARAM );
@@ -4377,6 +4413,7 @@ static int hb_compCompile( HB_COMP_DECL, const char * szPrg, const char * szBuff
hb_compOutStd( HB_COMP_PARAM, "\nNo code generated.\n" );
hb_compCompileEnd( HB_COMP_PARAM );
hb_compRestoreSwitches( HB_COMP_PARAM, &switches );
return HB_COMP_PARAM->fExit ? EXIT_FAILURE : iStatus;
}