From ac873f36cb927f4100ac54b62e787182b21249d5 Mon Sep 17 00:00:00 2001 From: anders_k Date: Tue, 4 Mar 2014 19:00:09 +0000 Subject: [PATCH] Added P<, P<=, P=, P<>, P>= and P> LogicLib ptrdiff_t tests git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6445 212acab6-be3b-0410-9dea-997c60f758d6 --- Docs/src/history.but | 1 + Include/LogicLib.nsh | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/Docs/src/history.but b/Docs/src/history.but index 73fa5248..fbb3a747 100644 --- a/Docs/src/history.but +++ b/Docs/src/history.but @@ -15,6 +15,7 @@ Released on ?, 2014 \S2{} Minor Changes \b Added Int<32|64|Ptr> helper macros to Util.nsh +\b Added P<, P<=, P=, P<>, P>= and P> LogicLib ptrdiff_t tests \H{v3.0a2} 3.0 Alpha 2 diff --git a/Include/LogicLib.nsh b/Include/LogicLib.nsh index 9a39a489..4fdd527f 100644 --- a/Include/LogicLib.nsh +++ b/Include/LogicLib.nsh @@ -52,6 +52,8 @@ ; a U< b; a U>= b; a U> b; a U<= b ; 64-bit integer tests (using System.dll): ; a L= b; a L<> b; a L< b; a L>= b; a L> b; a L<= b +; ptrdiff_t integer tests +; a P= b; a P<> b; a P< b; a P>= b; a P> b; a P<= b ; Built-in NSIS flag tests: ; ${Abort}; ${Errors}; ${RebootFlag}; ${Silent} ; Built-in NSIS other tests: @@ -250,6 +252,33 @@ !insertmacro _L> `${_a}` `${_b}` `${_f}` `${_t}` !macroend + ; ptrdiff_t tests + !macro LogicLib_PtrDiffTest _o _a _b _t _f + !if ${NSIS_PTR_SIZE} <= 4 + !insertmacro _${_o} `${_a}` `${_b}` `${_t}` `${_f}` + !else + !insertmacro _L${_o} `${_a}` `${_b}` `${_t}` `${_f}` + !endif + !macroend + !macro _P= _a _b _t _f + !insertmacro LogicLib_PtrDiffTest = `${_a}` `${_b}` `${_t}` `${_f}` + !macroend + !macro _P<> _a _b _t _f + !insertmacro LogicLib_PtrDiffTest <> `${_a}` `${_b}` `${_t}` `${_f}` + !macroend + !macro _P< _a _b _t _f + !insertmacro LogicLib_PtrDiffTest < `${_a}` `${_b}` `${_t}` `${_f}` + !macroend + !macro _P>= _a _b _t _f + !insertmacro LogicLib_PtrDiffTest >= `${_a}` `${_b}` `${_t}` `${_f}` + !macroend + !macro _P> _a _b _t _f + !insertmacro LogicLib_PtrDiffTest > `${_a}` `${_b}` `${_t}` `${_f}` + !macroend + !macro _P<= _a _b _t _f + !insertmacro LogicLib_PtrDiffTest <= `${_a}` `${_b}` `${_t}` `${_f}` + !macroend + ; Flag tests !macro _Abort _a _b _t _f IfAbort `${_t}` `${_f}`