当我两次调用宏函数(在一个部分内)时,我得到了这个编译错误:
错误:标签“CheckForRMSCustomisationLoop:”已在部分中声明
我理解它,因为我定义了一个标签(跳转)两次,对吗?
我怎样才能避免这个问题?
我必须将宏转换为函数还是有更简单的方法?因为转换为函数意味着我不能传递参数,所以我必须使用堆栈。
Outfile "RequireAdmin.exe"
RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on)
!include LogicLib.nsh
!macro Test param1 param2
TestLabel1:
DetailPrint "TestLabel1"
TestLabel2:
DetailPrint "TestLabel2"
!macroend
Section
!insertmacro Test 1 2
!insertmacro Test 3 4
IfErrors 0 +2
MessageBox MB_ICONEXCLAMATION|MB_OK "Unable to write to the registry" IDOK +1
SectionEnd
Function TestFunct # I MISS MY PARAMS :(
Pop $R9 # represents param2: but actually having param2 is SO MUCH more descriptive
Pop $R8
TestLabel1:
DetailPrint "TestLabel1"
TestLabel2:
DetailPrint "TestLabel2"
FunctionEnd
/* Usage
Push 1
Push 2
Call TestFunct
Push 3
Push 4
Call TestFunct
*/