macro __imp_ n {
match =n,n \{
display '__imp_' # `n,13,10
extrn __imp_\#n :QWORD
n equ __imp_\#n
\}
call [n]
}
How it works? First, MACRO invocation replaces "n" in the MATCH line to become: MATCH =
Name,
Name. Next, if
Name is referenced to another value with EQU then the MATCH will resolve to EQU value - which should not be
Name. Otherwise
Name does =
Name.
Note how several macro calls result in only the first MATCH block being executed and all from the preprocessor because MATCH resolves EQU. This pattern can be used to create a list of unique items without searching the list for existing entries. The EQU could be a LOCAL name to encapsulate the abstraction.