if directive
Syntax
if (expr) {directives[ } else if (expr) {directives] [ } else {directives] }
where expr is an expression, see Expressions in linker configuration files.
Parameters
| Any ILINK directive. |
Description
An if directive includes or excludes other directives depending on a condition, which makes it possible to have directives for several different memory configurations, for example, both a banked and non-banked memory configuration, in the same file.
The text inside a non-selected part of an if directive is not checked for syntax. The only requirements for such text, is that it can be tokenized, and that any open brace ({) token has a matching close brace (}) token.
Because there are no mutable constructs in linker configuration files, context can only be added, not removed or modified. This means that if conditions are resolved when the context for them is available. For example, if(x > 5) will be resolved when x has a well-defined value, or give an error if no definition for x can be found without resolving the condition.
Example
See Empty region.