Try to warn the user if they forgot to declare the function

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7257 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2021-01-27 02:27:53 +00:00
parent 47e9a6d5ba
commit 1cae67f562
2 changed files with 16 additions and 4 deletions

View file

@ -6,6 +6,15 @@ o-----------------------------------------------------------------------------o
| <cevo_deguix@yahoo.com.br> -------------------------------|
| |
| This header file contains NSIS functions for string manipulation. |
| ---------|
| !include "StrFunc.nsh" / Example |
| ${Using:StrFunc} StrRep -----------|
| |
| Section |
| ${StrRep} $0 "Hello world!" "world" "everyone" |
| MessageBox mb_ok $0 |
| SectionEnd |
| |
o-----------------------------------------------------------------------------o
*/
@ -86,12 +95,15 @@ o-----------------------------------------------------------------------------o
!define `${Name}` `!insertmacro STRFUNC_CALL_${Name} "${un}" `
!define `Un${Name}` `!insertmacro STRFUNC_CALL_${Name} "${un}" `
!else
!define `${Name}` `!insertmacro STRFUNC_MAKEFUNC ${Name} ""`
!define `Un${Name}` `!insertmacro STRFUNC_MAKEFUNC ${Name} Un`
!define `${Name}` `!insertmacro STRFUNC_MAKEFUNC ${Name} "" #`
!define `Un${Name}` `!insertmacro STRFUNC_MAKEFUNC ${Name} Un #`
!endif
!macroend
!macro STRFUNC_MAKEFUNC basename un
!ifndef __GLOBAL__
!error "You forgot ${U+24}{Using:StrFunc} ${un}${basename}"
!endif
!insertmacro STRFUNC_MAKEFUNC_${basename}
!macroend