Added IntPtrCmp, IntPtrCmpU, Int64Cmp and Int64CmpU
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6930 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
34e9873d5f
commit
1a039ca71f
9 changed files with 99 additions and 61 deletions
|
@ -46,11 +46,7 @@
|
|||
!define Int64Op '!insertmacro Int64Op '
|
||||
!define IntPtrOp '!insertmacro IntPtrOp '
|
||||
!macro Int32Op r a o b
|
||||
!if ${NSIS_PTR_SIZE} <= 4
|
||||
IntOp `${r}` `${a}` `${o}` ${b}
|
||||
!else
|
||||
!error "Int32Op not implemented"
|
||||
!endif
|
||||
IntOp `${r}` `${a}` `${o}` ${b}
|
||||
!macroend
|
||||
!macro Int64Op r a o b
|
||||
!echo "Int64Op ${r}=${a}${o}${b}"
|
||||
|
@ -67,13 +63,10 @@ IntPtrOp `${r}` `${a}` `${o}` `${b}`
|
|||
!define Int64Cmp '!insertmacro Int64Cmp '
|
||||
!define IntPtrCmp '!insertmacro IntPtrCmp '
|
||||
!macro Int32Cmp a b jeek jles jgtr
|
||||
!if ${NSIS_PTR_SIZE} <= 4
|
||||
IntCmp `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`
|
||||
!else
|
||||
!error "Int32Cmp not implemented"
|
||||
!endif
|
||||
IntCmp `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`
|
||||
!macroend
|
||||
!macro Int64Cmp a b jeek jles jgtr
|
||||
!if ${NSIS_PTR_SIZE} <= 4
|
||||
!ifmacrondef _LOGICLIB_TEMP
|
||||
!include LogicLib.nsh
|
||||
!endif
|
||||
|
@ -82,24 +75,19 @@ IntPtrOp `${r}` `${a}` `${o}` `${b}`
|
|||
${IfThen} ${a} L= ${b} ${|} Goto ${jeek} ${|}
|
||||
!insertmacro _L< ${a} ${b} `${jles}` `${jgtr}`
|
||||
!verbose pop
|
||||
!else
|
||||
Int64Cmp `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`
|
||||
!endif
|
||||
!macroend
|
||||
!macro IntPtrCmp a b jeek jles jgtr
|
||||
!if ${NSIS_PTR_SIZE} <= 4
|
||||
${Int32Cmp} `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`
|
||||
!else
|
||||
${Int64Cmp} `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`
|
||||
!endif
|
||||
IntPtrCmp `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`
|
||||
!macroend
|
||||
|
||||
!define Int32CmpU '!insertmacro Int32CmpU '
|
||||
!define Int64CmpU '!insertmacro Int64CmpU '
|
||||
!define IntPtrCmpU '!insertmacro IntPtrCmpU '
|
||||
!macro Int32CmpU a b jeek jles jgtr
|
||||
!if ${NSIS_PTR_SIZE} <= 4
|
||||
IntCmpU `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`
|
||||
!else
|
||||
!error "Int32CmpU not implemented"
|
||||
!endif
|
||||
IntCmpU `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`
|
||||
!macroend
|
||||
!macro Int64CmpUHelper
|
||||
; This macro performs "$_LOGICLIB_TEMP = a < b ? -1 : a > b ? 1 : 0" but System::Int64Op does not support unsigned operations so we have to perform multiple steps
|
||||
|
@ -148,6 +136,7 @@ Pop $1
|
|||
Pop $2
|
||||
!macroend
|
||||
!macro Int64CmpU a b jeek jles jgtr
|
||||
!if ${NSIS_PTR_SIZE} <= 4
|
||||
!echo "Int64CmpU ${a}:${b} =${jeek}, <${jles}, >${jgtr}"
|
||||
!verbose push 2
|
||||
Push `${a}`
|
||||
|
@ -155,13 +144,12 @@ Push `${b}`
|
|||
!insertmacro CallArtificialFunction Int64CmpUHelper
|
||||
IntCmp $_LOGICLIB_TEMP 0 `${jeek}` `${jles}` `${jgtr}`
|
||||
!verbose pop
|
||||
!else
|
||||
Int64CmpU `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`
|
||||
!endif
|
||||
!macroend
|
||||
!macro IntPtrCmpU a b jeek jles jgtr
|
||||
!if ${NSIS_PTR_SIZE} <= 4
|
||||
${Int32CmpU} `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`
|
||||
!else
|
||||
${Int64CmpU} `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`
|
||||
!endif
|
||||
IntPtrCmpU `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`
|
||||
!macroend
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue