diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2017-04-23 15:48:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-25 10:04:53 +0200 |
commit | 6b448d3634f26224e480c0f30c617eacd7b4e3ab (patch) | |
tree | e829dd9ce5207e29be890c309e3b5ceaa3e4eea9 /rsc/source | |
parent | da64d198ec3b31318c92ad4bcaab18cc2bf5cfdc (diff) |
make __RSC a builtin define for the RSC compiler
instead of randomly defining it in only some of .src files
Change-Id: Ifec3920740723d248400f451d717b5288c421b8d
Reviewed-on: https://gerrit.libreoffice.org/36832
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'rsc/source')
-rw-r--r-- | rsc/source/parser/rsclex.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/rsc/source/parser/rsclex.cxx b/rsc/source/parser/rsclex.cxx index 37ea1d3b3973..f240903c9b05 100644 --- a/rsc/source/parser/rsclex.cxx +++ b/rsc/source/parser/rsclex.cxx @@ -65,6 +65,7 @@ static bool bTargetDefined; StringContainer* pStringContainer = nullptr; +static RscDefine RSC_GLOBAL_DEFINE(RscFileTab::Index(0), OString("__RSC"), 1); sal_uInt32 GetNumber() { @@ -275,7 +276,11 @@ int MakeToken( YYSTYPE * pTokenVal ) // Symbol RscDefine * pDef; - pDef = pTC->aFileTab.FindDef( aBuf.getStr() ); + // this #define symbol is used to indicate to various code that it is being processed with the RSC compiler + if (strcmp(aBuf.getStr(), "__RSC") == 0) + pDef = &RSC_GLOBAL_DEFINE; + else + pDef = pTC->aFileTab.FindDef( aBuf.getStr() ); if( pDef ) { pTokenVal->defineele = pDef; |