1.4.1. Macro definition

A macro definition must contain:

The syntax of a macro definition is as follows:

DEFINE [/R] [return_type] macro_name([parameter_list])
[param_definitions]
{
    macro_body
}
.

where:

/R

The new macro can replace an existing symbol with the same name.

return_type

The return type for the macro and is an optional component of the macro definition. The default type is int.

Note

One use of a macro return value is to control what action RealView Debugger takes when a conditional breakpoint is triggered (for example, see BREAKINSTRUCTION).

parameter_list

A parameter list for the macro and is an optional component of the macro definition. You specify a parameter list in the same way that you specify arguments for a C function. If parameter_list is defined then the type must also be specified or else type int is assumed. The following example illustrates the use of a parameter_list:

define int scpy(target, source)
char *target;
char *source;

The declaration defines arguments for the macro scpy(). The type of both the target and the source are declared to be pointers to a char.

Note

For full details on the DEFINE command, see DEFINE on DEFINE.

Copyright © 2005, 2006 ARM Limited. All rights reserved.ARM DUI 0284C
Non-Confidential