Added <<, >> and >>> !define /math operations

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6199 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2011-12-06 21:04:47 +00:00
parent 67d0b165b1
commit dca62fbbc7
3 changed files with 8 additions and 2 deletions

View file

@ -3062,6 +3062,12 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
_stprintf(value,_T("%d"),value1|value2);
} else if (!_tcscmp(mathop,_T("^"))) {
_stprintf(value,_T("%d"),value1^value2);
} else if (!_tcscmp(mathop,_T("<<")) || !_tcscmp(mathop,_T("<<<")) ) {
_stprintf(value,_T("%d"),value1<<value2);
} else if (!_tcscmp(mathop,_T(">>"))) {
_stprintf(value,_T("%d"),(signed)value1>>(signed)value2);
} else if (!_tcscmp(mathop,_T(">>>"))) {
_stprintf(value,_T("%d"),(unsigned)value1>>(unsigned)value2);
} else if (!_tcscmp(mathop,_T("/"))) {
if (value2==0) {
ERROR_MSG(_T("!define /math: division by zero! (\"%i / %i\")\n"),value1,value2);