Added !define /ifndef and !define /redef optional arguments
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6097 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
74ffaada4e
commit
d526c78d05
3 changed files with 19 additions and 2 deletions
|
@ -2799,6 +2799,21 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
GrowBuf file_buf;
|
||||
TCHAR datebuf[256];
|
||||
TCHAR mathbuf[256];
|
||||
int dupemode=0;
|
||||
|
||||
|
||||
if (!_tcsicmp(define,_T("/ifndef")))
|
||||
dupemode=1;
|
||||
else if (!_tcsicmp(define,_T("/redef")))
|
||||
dupemode=2;
|
||||
|
||||
if (dupemode!=0)
|
||||
{
|
||||
line.eattoken();
|
||||
define=line.gettoken_str(1);
|
||||
if (dupemode==1 && definedlist.find(define))return PS_OK;
|
||||
}
|
||||
|
||||
|
||||
if (!_tcsicmp(define,_T("/date")) || !_tcsicmp(define,_T("/utcdate"))) {
|
||||
if (line.getnumtokens()!=4) PRINTHELP()
|
||||
|
@ -2903,6 +2918,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
value=line.gettoken_str(2);
|
||||
}
|
||||
|
||||
if (dupemode==2)definedlist.del(define);
|
||||
if (definedlist.add(define,value))
|
||||
{
|
||||
ERROR_MSG(_T("!define: \"%s\" already defined!\n"),define);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue