1.5.5. Macro local symbols

You can create symbols in a macro that are local to the macro. You must declare a type for macro local symbols. The type can be any legal C or C++ data type, except const. For example:

define /R int sqrValue(value)
int value;
{
    int squared;
    squared = value * value;
    return squared;
}
.

All symbols declared within a macro exist only during the execution of the macro, that is the static keyword is not recognized.

To create the equivalent of a global static variable, use the ADD command to create the symbol before defining the macro that references the symbol. For example:

add int cnt
define /R counter()
{
    cnt = cnt + 1;
}
.

See also

Copyright © 2002-2010 ARM Limited. All rights reserved.ARM DUI 0175M
Non-ConfidentialID102410